usb serial port from TI cc2540 not discovered
Brought to you by:
cliechti
the CDC serial ports used in devices such as TI cc2540 are not listed in the results from serial.tools.list_ports.comports()
platform: windows 7
release version: pyserial-2.6
python version 2.7.3
For some reason they do not appear to be returned in the device information set from SetupDiGetClassDevs.
I noticed the have a different driver key than the built-in serial ports:
built-in serial port driver key: {4d36e978-e325-11ce-bfc1-08002be10318}\0000
TI usb CDC com port: {4d36e978-e325-11ce-bfc1-08002be10318}\0012
they have the same device class guid {4d36e978-e325-11ce-bfc1-08002be10318}
BTW, this discussion on stack overflow
http://stackoverflow.com/questions/3187049/using-pyserial-to-connect-to-a-non-com-port
recommends using SetupDiClassGuidsFromName
The problem lies in the enumeration code you linked. It is wrong in two regards:
It uses a fixed GUID_CLASS_COMPORT to enumerate. It should instead ask the GUID through SetupDiClassGuidsFromName, passing "Ports" as description of the class for which it is asking for names.
fix committed. It finds CDC ports now too.
Unfortunately does it also find LPT ports, which then are explicitly ignored. Not sure if other such as com0com will show up (it has unsigned drivers, installation failed, thus not tested).