device filtering support
Xiaofan Chen
xiaofanc at gmail.com
Wed Feb 8 22:04:39 EST 2012
On Wed, Feb 8, 2012 at 10:26 PM, Hans de Goede <hdegoede at redhat.com> wrote:
> The information which I need is:
> 1) the device descriptors (so as to be able to show a pid/vid to
> the user in some use cases)
> 2) the config descriptors (to find out the interface classes
> needed for the class based filtering I have)
> 3) string descriptors (Product and Manufacturer string), to show
> user friendly descriptions of devices to the user.
>
> Note no speed or topology info. I only need speed info after
> opening the device, and I never need topology info (never say
> never, but atm I don't need it).
>
> 3. Actually is a problem atm, since libusb requires the device
> to be opened to get this. So for now I have Linux specific code
> in my usbredir code to get these directly from sysfs where
> Linux caches these and I'm working on code for going from 1.
> to something resembling 3. using Linux's usb.ids file, since
> some devices don't bother with reporting string descriptors
> at all.
>
> I'm thinking about adding support for getting the
> manufacturer and product string from a libusb_device to
> libusb itself, note the from a device not a device_handle!
>
> The idea would be to have platform specific code to do this,
> and when that fails fall back to getting the strings from usb.ids
> (we could ship our own copy for non Linux platforms).
Actually using a copy of usb.ids is what libusbK's klist
and libwdi do as well.
http://code.google.com/p/usb-travis/source/browse/#svn%2Ftrunk%2FlibusbK%2Fsrc%2FkList
http://libwdi.git.sourceforge.net/git/gitweb.cgi?p=libwdi/libwdi;a=blob;f=libwdi/vid_data.sh;hb=HEAD
> So a question from my side, what do people think about adding
> such functions to libusb? Good or bad idea?
I think it is a good idea no matter what we decide on device
filter, hotplug and other things.
--
Xiaofan
More information about the libusbx
mailing list