Add TODO comment and device log

This commit is contained in:
HuangMason320 2025-07-16 21:53:31 +08:00
parent e0169cd845
commit e34cdfb856

View File

@ -90,6 +90,8 @@ class MultiDongle:
print('[Scanning Devices]')
device_descriptors = kp.core.scan_devices()
print(device_descriptors)
if not device_descriptors:
print(' - No devices found')
return []
@ -175,14 +177,13 @@ class MultiDongle:
str: Device series (e.g., 'KL520', 'KL720', etc.)
"""
try:
# Product ID to device series mapping
# TODO: Check Product ID to device series mapping
product_id_mapping = {
'0x100': 'KL520',
'0x720': 'KL720',
'0x630': 'KL630',
'0x730': 'KL730',
'0x540': 'KL540',
# Add more mappings as needed
}
# Handle dict format (from JSON)
@ -331,16 +332,16 @@ class MultiDongle:
# kp.core.set_timeout(device_group=self.device_group, milliseconds=5000)
# print(' - Success')
if self.upload_fw:
try:
print('[Upload Firmware]')
kp.core.load_firmware_from_file(device_group=self.device_group,
scpu_fw_path=self.scpu_fw_path,
ncpu_fw_path=self.ncpu_fw_path)
print(' - Success')
except kp.ApiKPException as exception:
print('Error: upload firmware failed, error = \'{}\''.format(str(exception)))
sys.exit(1)
# if self.upload_fw:
try:
print('[Upload Firmware]')
kp.core.load_firmware_from_file(device_group=self.device_group,
scpu_fw_path=self.scpu_fw_path,
ncpu_fw_path=self.ncpu_fw_path)
print(' - Success')
except kp.ApiKPException as exception:
print('Error: upload firmware failed, error = \'{}\''.format(str(exception)))
sys.exit(1)
# upload model to device
try: