Is there a way to detect that a USB device is connected by detecting power consumption and not the device driver?

I am creating a system that should handle broken devices that may or may not have a working USB connector. I would like to know if the USB subsystem can be asked if the port consumes power or not.

+6
source share
1 answer

If you really want to do this, you will have to dig deep:

http://www.usb.org/developers - all relevant USB standards documents

http://www.beyondlogic.org/usbnutshell/usb1.shtml - some useful information
http://www.libusb.org/ - a very low level USB management library
http://www.acpi.info/DOWNLOADS/ACPIspec40a.pdf - ACPI may provide some help
http://msdn.microsoft.com/en-us/library/aa394504%28v=VS.85%29.aspx - WMI class for accessing USB related information

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

+5
source

Source: https://habr.com/ru/post/893968/


All Articles