I would like to automatically read all of the devices connected to the computer, so that I can communicate with all of the Keyspans, and none of the other devices. I am using Python, with the PySerial module.
The closest I have gotten is through CMD:
python -m serial.tools.list_ports -v
COM1
desc: Communications Port (COM1)
hwid: ACPI\PNP0501\2
COM3
desc: Keyspan USB Serial Port (COM3)
hwid: KEYSPAN\*USA19HMAP\00_00
COM4
desc: Keyspan USB Serial Port (COM4)
hwid: KEYSPAN\*USA19HMAP\01_00
3 ports found
I would really like to get this information using a python script instead, something like
print(serial.tools.comports)
but all that returns is
[<serial.tools.list_ports_common.ListPortInfo object at 0x00000000044022C8>,
<serial.tools.list_ports_common.ListPortInfo object at 0x00000000043F8288>,
<serial.tools.list_ports_common.ListPortInfo object at 0x00000000043F8388>]
and I am not exactly sure what that means. If you have any suggestions I would love to hear them! EDIT: Thanks for the help!