瀏覽代碼

增加了读的时候FE字段的判断

chenjiangqun 2 年之前
父節點
當前提交
55d8974c24
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      FactoryTool_CShare/IO/SerialCMD.cs

+ 7 - 1
FactoryTool_CShare/IO/SerialCMD.cs

@@ -2874,8 +2874,14 @@ namespace MOKA_Factory_Tools
                         }                           
                         }                           
                         else
                         else
                         {
                         {
-                            int mark1= Comport.ReadByte();
+                            int mark1= Comport.ReadByte();                    
                             result[6] = (byte)mark1;
                             result[6] = (byte)mark1;
+                            if (result[6]!=0xFE)
+                            {                           
+                                Log.WriteInfoLog("返回错误,返回的第二段串口值不正确");
+                                return false;
+                            }
+
                             int k1 = Comport.ReadByte();
                             int k1 = Comport.ReadByte();
                             int k2 = Comport.ReadByte();
                             int k2 = Comport.ReadByte();
                             result[7] = (byte)k1;
                             result[7] = (byte)k1;