根据新版本调整set_pattern:0~65535
This commit is contained in:
@@ -243,6 +243,13 @@ class BaseIO:
|
||||
self.__ref_count = tsi.TSI_Clean()
|
||||
logging.info(f"[UniTAP] BaseIO.del: {self}; Ref count: {self.__ref_count}")
|
||||
|
||||
def rescan_devices(self):
|
||||
if self.__ref_count > 0:
|
||||
tsi.TSIX_DEV_RescanDevices()
|
||||
return
|
||||
logging.error("[UniTAP] BaseIO.rescan_devices call without TSI_Init")
|
||||
|
||||
|
||||
def get_device_count(self) -> int:
|
||||
if self.__ref_count > 0:
|
||||
return tsi.TSIX_DEV_GetDeviceCount()
|
||||
|
||||
@@ -70,6 +70,11 @@ class TsiLib:
|
||||
self.__io.cleanup()
|
||||
logging.info(f"[UniTAP] TsiLib.cleanup {self}")
|
||||
|
||||
def rescan_devices(self):
|
||||
"""Rescan USB for newly connected TSI devices without tearing down the library."""
|
||||
self.__io.rescan_devices()
|
||||
logging.info(f"[UniTAP] TsiLib.rescan_devices {self}")
|
||||
|
||||
def __del__(self):
|
||||
"""
|
||||
Automatically call the destructor after the script completes.
|
||||
|
||||
Reference in New Issue
Block a user