-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB detection #2338
Comments
This is a very common request for ports. Listing ports over and over is a poor solution when we can have usb auto detection. The complixity is around cross platform support and which subsystem handles the port. Old com port or tty interfaces don't have this concept so we'd have to look at the usb interfaces and correlate between them. We do have some code that does this in windows (which seems to use old registry entries), but not so much in linux or osx iirc. |
On the Darwin point I wonder if the new driverkit will make this any easier |
This package does it correctly emit events when I plug in my device but for some reason, I had to add a timeout otherwise serialport wouldn't be able to connect. |
Yes, this is what I did on my version.
Thanks for pointing out that lib, I don't think it was public when I started my project 2 years ago. |
The other thing I found is you have to detect the serial port from the Windows ports class as followed:
Then you can match "USB\VID_%04X&PID_%04X" on the usbid:
|
@reconbot @GazHank
💥 Proposal
What feature you'd like to see
I would like the ability to detect USB serial ports being added and removed from the computer. Like most USB to serial devices such as FTDI you can set personalised USB VID's and PID's which are used to identify peoples bespoke hardware.
Motivation
To enable people to event driven detect their devices upon being plugged in to the system, open a serial port and start processing data.
Pitch
The concept would you you can initialise the monitoring of a custom VID and PID and it would return the data relevant to opening a serial port. In some instances it might not be a COM1 or ttyUSB0 but a FDTI USB driver.
On Darwin I have not yet worked on the solution. If the project goes ahead I am happy to contribute to it.
Regards
J
cDevice.zip
The text was updated successfully, but these errors were encountered: