Browse Source

连接逻辑调整

rambo 4 months ago
parent
commit
152cfd3caf
1 changed files with 2 additions and 12 deletions
  1. 2 12
      python/mcu/DeviceControl.py

+ 2 - 12
python/mcu/DeviceControl.py

@@ -910,13 +910,6 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
                 self.sendSocketMessage(msg="检查设备初始化", data=message)
         return
 
-    # def init(self, sign_data):
-    #     if sign_data["type"] == "connect_sign":
-    #         if sign_data["data"] == 0:
-    #             self.is_running = False
-    #         else:
-    #             self.is_running = True
-
     def scan_serial_port(self) -> dict:
         # 获取所有可用串口列表
         ports_dict = {}
@@ -1046,7 +1039,8 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
             if receive_data[0] == 90:
                 connect_flag = receive_data[1]
                 device_id = receive_data[2]
-
+        else:
+            return False
         print("关闭串口:{}".format(port_name))
         logger.info("关闭串口:%s", port_name)
         serial_handle.close()
@@ -1098,10 +1092,6 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
             return False
             # 走其他途径处理
 
-        # 检查当前MCU链接是否正常
-        # 正常跳过;记录为其他列表
-        # 不正常进行尝试连接
-        # 连接不上,记录为其他列表
 
     def clearMyInstance(self):
         SingletonType.clear_instance()