wjwwood / serial

Cross-platform, Serial Port library written in C++
http://wjwwood.github.com/serial/
MIT License
2.16k stars 1.05k forks source link

Not detecting all serial ports on Windows #202

Open tehKaiN opened 5 years ago

tehKaiN commented 5 years ago

So far everything worked fine for me in my app, but apparently this library doesn't detect virtual serial ports exposed by some 3rd party apps, namely VSPE virtual serial port emulator.

I've noticed that Realterm doesn't have this issue, so I peeked into its sources and it detects serial ports using registry path HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM.

I think that VPSE may be doing something wrong in adding its serial ports to Windows, but perhaps it'd be wise to expand current serial port list code by looking for additional ports in this registry path?

zhouscd commented 5 years ago

We should use GUID_DEVINTERFACE_COMPORT instead of GUID_DEVCLASS_PORTS to scan serial ports on Windows see: https://docs.microsoft.com/en-us/windows-hardware/drivers/install/guid-devinterface-comport

wjwwood commented 3 years ago

A pull request would be welcome. A potentially related pull request was recently merged: https://github.com/wjwwood/serial/pull/179