修改linux和window下的ch341兼容问题

This commit is contained in:
jinggaoyang-68
2024-12-10 12:55:02 +08:00
parent 22786992f7
commit f7d0e8755d
3 changed files with 52 additions and 50 deletions

View File

@ -46,6 +46,16 @@ class ClassCapRead:
self.connectStatus = EnumCh341ConnectStatus.CH341_CONNECT_INIT
self.connectDebug()
def __del__(self):
if self.vofaClient:
self.vofaClient.close()
self.ch341.disconnect()
print("ch341释放")
pass
def connectDebug(self):
#连接到调试的服务器
self.vofaClient = socket.socket()
addr = ('127.0.0.1', 1347)
@ -57,12 +67,6 @@ class ClassCapRead:
except Exception as e:
self.socketConnected = 0
print('连接服务器失败')
def __del__(self):
if self.vofaClient:
self.vofaClient.close()
self.ch341.disconnect()
print("ch341释放")
pass
def set_sensor_enable(self, idx):
_pack = list()