[libhid-discuss] Need API for identifying the port no to which the usb device is connected

shivaprasad javali jbsp72 at gmail.com
Tue Jun 24 05:37:27 UTC 2008


I want to get the port no programatically from within my c driver code. I
could parse the device files to get the port no I want but is there any
better way like an API or something that I can use to get this no easily.

Thanks
Shivaprasad

On Tue, Jun 24, 2008 at 10:59 AM, Peter Stuge <stuge-libhid at cdy.org> wrote:

> On Tue, Jun 24, 2008 at 10:22:53AM +0530, shivaprasad javali wrote:
> > The location being printed there is the busnumber/devicefilename.
> > While this might be useful for me I am looking for a way for me to
> > get the port no of the usb device. When I look at the file
> > /proc/bus/usb/devices I get a port no field for each usb device
> > there. Thats the port no I want to know about my USB device. Is
> > there any way to get that port no.
>
> See thread on libusb list.
>
> You could of course parse /proc/bus/usb/devices, but it is preferred
> to look your device up in the /sys/bus/usb/devices/ directory. The
> link for your device has encoded in it the port number it is
> connected to.
>
>
> //Peter
>
> _______________________________________________
> libhid-discuss mailing list
> libhid-discuss at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
>


More information about the libhid-discuss mailing list