tags:

views:

247

answers:

3

I don't necessarily need to see real time plots or anything but as I understand it if you attach a USB device it gets like 100 mA then after some negotiation it will bump the power up to 300 mA or 500 mA so on and so forth till the device stops requesting.

Does anyone know of anyway to see all the USB ports on a machine and what they are "allowed" to output?

edit update:

in windows preferably using a .net language

A: 

I found some interesting files under /sys but couldn't get anywhere with it.

In Ubuntu Linux, become root and cd to /sys/bus/usb/devices/usb1

root@pjb-desktop:/sys/bus/usb/devices/usb1# ls
1-0:1.0              bDeviceSubClass     configuration  idVendor      speed
authorized           bmAttributes        descriptors    manufacturer  subsystem
authorized_default   bMaxPacketSize0     dev            maxchild      uevent
bcdDevice            bMaxPower           devnum         power         urbnum
bConfigurationValue  bNumConfigurations  driver         product       version
bDeviceClass         bNumInterfaces      ep_00          quirks
bDeviceProtocol      busnum              idProduct      serial
root@pjb-desktop:/sys/bus/usb/devices/usb1# cat bMaxPower 
  0mA

This seems to show current.

OK lets be a little creative here...

cat /sys/bus/usb/devices/usb?/bMaxPower0mA


 0mA
  0mA
  0mA
  0mA
  0mA
  0mA
  0mA

will list all of them.

I tried plugging in a USB stick and got it active so the LED was blinking. I could not sense any change in these indications. There is also a power directory but I found nothing in there I could decipher..

So sorry if this is a dead end but I think with a bit more looking you might find what you are after.

Paul
Question was changed to windows based after my answer. I'll leave it up in case someone is interested.
Paul
I think that most USB interface chips don't provide that information.
Brad Gilbert
+1  A: 

Shot in the dark, but if this data is anywhere, it'll be in WMI, or you might be able to get the info from an ETW trace of usbhub/usbport.

Paul Betts
I thought the same thing, so I browsed around using the WMI Object Browser so I could provide the asker with the WMI Class, but I could not find one.
Nick
+1  A: 

It must be available somewhere because if (in XP) you go to device manager and select one of the USB Root Hubs theer is a power tab in the properties dialog that details the power that has been requested by the devices plugged into each of the ports.

I am not a windows programmer so I do not know how to find this out programatically.

Ian