Flemming Harms wrote:
I have question I hope you folks can help me with. I'm looking for API
where I receive an event when the USB device is connected or
disconnected and the ability to request "Safely Remove Hardware" from
my application. (Like you can do in Windows)
In the javax.usb API you can get events when devices are connected
(attached) to and disconnected (detached) from the system. Take a look
at javax.usb.HostManager, javax.usb.UsbServices and
javax.usb.event.UsbServicesListener. **
I can see the API supports event listeners for connect and disconnect,
but I can't find any method where I can request "Safely Remove
Hardware" method (windows).
The "Safely Remove Hardware" in Windows is not USB specific. USB itself
supports adding and removal during system operation, but the USB device
might not logically (although it must physically). The operations for
"Safely Remove Hardware" depends on the device.
Example 1.
If the device is a Mass Storage Device you might want to stop further
read / writes to the device file system and flush pending writes.
Example 2.
If the device is a network interface you probably want to shutdown the
newtwork interface and start NACKing incoming packets.
//Roger
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
javax-usb-devel mailing list
javax-usb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel