Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to detect that a USB device is plugged in by detecting power draw rather than it's device driver?

Tags:

windows

usb

I am building a system that needs to handle broken devices that may or may not have a working USB plug. Would like to know if can ask USB subsystem if a port is drawing power or not.

like image 909
Eric Arseneau Avatar asked Jul 30 '11 23:07

Eric Arseneau


1 Answers

If you really want to do that you will have to dig deep:

http://www.usb.org/developers - all relevant USB standards documents
http://www.beyondlogic.org/usbnutshell/usb1.shtml - some usefull information
http://www.libusb.org/ - a library to handle USB at a very low level
http://www.acpi.info/DOWNLOADS/ACPIspec40a.pdf - ACPI could provide some help
http://msdn.microsoft.com/en-us/library/aa394504%28v=VS.85%29.aspx - WMI class to access USB related info

for a non-development solution and/or check when debugging:
http://www.devicedriverfinder.com/blog/device-drivers/how-to-check-usb-power-usage

like image 160
Yahia Avatar answered Nov 12 '22 12:11

Yahia