Re: detection usb camera devices in my own application

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 12 Jul 2011, Sudarshan Jagadale wrote:

> hello alan,
> 
> If i dont want to use any library or usb.h in my hotplug detection and
> removal code then is there other way to do this?

You can copy the code from libusb into your own program, if you're 
willing to follow the license requirements.

> I just want following information from system/kernel to my module like,
> idvendor,idproduct, bus_info, system device name?
> Bus info should be like we use in /dev/video0? is there any way to do this?
> in short i would like to make path equivalant to *usb_make_path()? how can i
> achive this ?

You can look through the directories under /sys/bus/usb/devices/.  
Ignore directory names that start with "usb" or that contain a ':', 
because they don't refer to external devices.

Within each of the remaining directories, the vendor ID is in a file 
named idVendor and the product ID is in a file named idProduct.  I 
don't know what you mean by "bus_info" or "system device name".

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux