开发者

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

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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜