Browse Source

修复GetDeviceCode失败的Bug。

JeffWang 2 năm trước cách đây
mục cha
commit
4206169692
1 tập tin đã thay đổi với 4 bổ sung7 xóa
  1. 4 7
      FactoryTool_CShare/IO/SerialCMD.cs

+ 4 - 7
FactoryTool_CShare/IO/SerialCMD.cs

@@ -1837,22 +1837,19 @@ namespace MOKA_Factory_Tools
                 if (data[0] == 0x11 & data[1] == 0x06)
                 {
                     data = data.Skip(2).Take(data.Length - 2).ToArray();
-                    if (data.Length != 3)
-                    {
-                        error = "返回DevcieCode长度错误,应为3 bytes";
-                        return false;
-                    }
+                    if (data.Length == 3)
+                        return true;
+                    error = "返回DevcieCode长度错误,应为3 bytes";
                 }
                 else
                 {
                     error = "返回DevcieCode类型错误,应为0x11 0x06";
-                    return false;
                 }
             }
 
             Log.WriteInfoLog(string.Format("GetDeviceCode Elapsed = {0}", watch.Elapsed.TotalMilliseconds));
             
-            return true;
+            return false;
         }
 
         /// <summary>