[Nut-upsdev] More information on USB bus

Arjen de Korte nut+devel at de-korte.org
Sat Sep 1 08:18:39 UTC 2007

Arjen de Korte wrote:


>>> On USB bus 1, I have two sockets and it clearly makes a difference in
>>> which I put the connector. The kernel will report either 'usb 1-1' or
>>> 'usb 1-2'. Is there a way to get to this information through libusb?
>>> From a posting today on nut-users, it looks like we need more
>>> granularity than just the bus.
>> I think that is something you can infer from the usb_device structure
>> (the filename member). Not sure if that's considered portable, though.
> I'll have a look. It seemed obvious that this would be in the usb_bus
> structure, but that proved to be a wrong assumption.

That probably doesn't work. The output of 'lsusb -v' is identical
(except for the device, but that is an enumerated value, so that has
nothing to do with the physical port it is connected to).

We'll probably need something low-level to find out the physical port. I
agree in advance that this is probably not going to be portable without
some autoconf magic.

Best regards, Arjen

More information about the Nut-upsdev mailing list