Mr-Ntic / qextserialport

Automatically exported from code.google.com/p/qextserialport
Other
0 stars 0 forks source link

Need device details on *nix #4

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
We don't have a good way to extract device details on *nix platforms, such as 
vendor/product ID, 
manufacturer name, product name etc.  So even if we use some of the hack-ish 
ways to determine 
whether there are connected devices in /dev we never know much about them 
before opening them 
up and seeing if they respond to a particular protocol.  

If anybody has any suggestions on how to obtain device specific details like 
this, please chime in!

Original issue reported on code.google.com by lst...@gmail.com on 3 Jun 2009 at 4:22

GoogleCodeExporter commented 8 years ago
The used kernel module can be determined with reading the 
/sys/class/[ttyName]/device file.

The VID/PID values are only intresting when you are using USB/Bluetooth/etc. to
serial ports.

USB ports:
Once you find out the driver name (ftdi_sio) you can get more information about 
the
USB-serial adapter could be found  at:
/sys/bus/usb/drivers/[driver name]
There will be symlinks to folders like this:
1-1.4:1.0
If you go to this directories, you will found a directory, named to [ttyName],
and found a file called interface, which is contains the device name (FT232R 
USB UART
for e.g.)

You can found an uevent named file which is contains the VID-PID in the 
following format:
PRODUCT=403/6001/600 (0403:6001)

I have posted a long time ago an implementation for the Posix enumeration, but 
it had
not been merged, because you said that, there are some other implementations to 
it,
and you will choose the best. Please choose the best, add it to the repo, and I 
will
hack into it the features described above. 

Original comment by martonmi...@gmail.com on 4 Jan 2010 at 7:23

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I have finished my code. 
It detects the VID-PID and the device name for the USB-serial ports if it is 
possible,
and finds the VID-PID for the CDC ACM, and bluetooth devices. 

Original comment by martonmi...@gmail.com on 5 Feb 2010 at 7:28

Attachments: