Other Parts Discussed in Thread: UNIFLASH
Hi,
I have an application that communicates with multiple devices over serial, which currently uses the Python code below to find the appropriate COM ports:
command = 'wmic path Win32_SerialPort get Name | find /v "Name"'
output = subprocess.check_output(command, shell=True, universal_newlines=True).splitlines()
for line in output:
if "Application/User UART" in line:
num = line.split("(COM")[1].split(")")[0]
devicelist.append(f"COM{num}")
This works great to grab all the devices and communicate in parallel, but we now want to also be able to call xdsdfu and uniflash via the CLI in Python to flash hex files to specific devices, as well as using the unique serial numbers of the devices to know which device is which (as the COM ports will change between computers). I initially tried using xdsdfu -e to read (and set custom) serial numbers, but I can't find a way to match these to a COM port so that I can also set up the serial communicaton.
Is there a command I'm missing, or some other tool available via the CLI, that I can use to find both the serial numbers and the associated COM ports, so that I can match these up?
Thanks,
Tom