device filtering support

Pete Batard pete at akeo.ie
Wed Feb 8 10:44:25 EST 2012


On 2012.02.08 14:26, Hans de Goede wrote:
> So a question from my side, what do people think about adding
> such functions to libusb? Good or bad idea?

In other words, you want libusb to perform some caching of various 
fairly static and enumeration-related USB properties that the OS can 
provide (possibly with querying, since there's no guarantee that all 
OSes will cache these internally), so that any libusb app can reference 
them, before attempting to open a device.

Personally, I think that libusb should indeed be able to provide a 
cached copy of all the descriptors you listed, as well as topology and 
speed data, or any kind of information we can obtain that is not 
expected to change for the duration of the device's presence. So 
obviously, I see it as a good idea.

Wouldn't it be great, then, if libusb had a cross platform process that 
did this kind of caching once per user session and handled enumeration 
and hotplug...?

What you describe is uncannily close to the potential problem I've been 
trying to solve. Again, the problem is we'd like to have the OS provide 
us much of the static USB data (descriptors, topology) we want to make 
readily available in libusbx at all times, and do that, as much as 
possible, in a cross platform manner, with caching, and with as few bus 
queries as possible.

Regards,

/Pete



More information about the libusbx mailing list