Hi all,

I am using Keyspan USB Serial Device. I found the below fact recently,
and want to get verification from you if this behavior is right or to
be updated.

I found that

   1. When the Keyspan USB device is plugged out, the application does
not handle file descriptor correctly.
   2. It checks the connectivity of USB device using open(), but
"OPEN" method does not tell actual connectivity. In real, when it is
not connected to anything, it returns file descriptor as -1. However,
once it is connected and opened, and when the device is disconnected,
the opened file descriptor does not to be gone automatically in kernel
side unless it calls close(). In this case, since the previous file
descriptor is still in kernel side, the device driver returns another
file descriptor when it tries to open() to check the connectivity even
though actual device is not connected.
   3. So, when it is disconnected and connected again, then the device
is recognized as ttyUSB1 (or another number different with previous
one) not ttyUSB0 because the previous file descriptor has not been
gone.

More simple question is How application knows whether Keyspan USB
Serial Device is connected or not. Is there any nice way to detect the
connectivity of the USB device?

Regards,
D. Song.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to