Browse Source

Merge remote-tracking branch 'origin/master'

panqiuyao 4 months ago
parent
commit
3a112043dc
1 changed files with 3 additions and 0 deletions
  1. 3 0
      python/sockets/socket_server.py

+ 3 - 0
python/sockets/socket_server.py

@@ -27,6 +27,8 @@ async def websocket_endpoint(websocket: WebSocket):
                     if socket_type == "websocket.disconnect":
                         device_ctrl.close_connect()
                         device_ctrl.mcu_exit = True
+                        device_ctrl.p_list = []
+                        device_ctrl.temp_ports_dict = {}
                         device_ctrl.clearMyInstance()
                         diviceList = blue_tooth.devices
                         if len(diviceList) == 0:
@@ -40,6 +42,7 @@ async def websocket_endpoint(websocket: WebSocket):
                             blue_tooth.disconnect_device(diviceAddress, diviceName)
                         blue_tooth.bluetooth_exit = True
                         blue_tooth.clearMyInstance()
+                        print("所有设备已断开连接")
                         break
                     print("byteDats", byteDats)
                     await handlerSend(conn_manager, json.dumps(byteDats), websocket)