device filtering support

Vitali Lovich vlovich at gmail.com
Fri Feb 3 20:16:21 EST 2012


On Feb 3, 2012, at 5:09 PM, Xiaofan Chen wrote:

> On Fri, Feb 3, 2012 at 10:07 PM, Hans de Goede <hdegoede at redhat.com> wrote:
>>> I believe most of the use cases of libusb only cares about one or a few
>>> particular device, with known VID/PIDs. Therefore I do not see the need
>>> of enumerating all device.
>> 
>> As the author of a piece of software which wants does care about any
>> random / all usb devices I respectfully disagree with this assumption.
>> 
> 
> The thing is that this may well work under Linux but certainly
> not Windows. You still need to install drivers for your random
> or all USB devices to talk to them and that is not feasible,
Not if it's a HID device or is already supported by WINUSB.....  Also, being able to find the device & having an easy way to say: install libusbk for this device (e.g. libusb_detach_kernel_driver) could do that could be beneficial.
> 
>>> Just another example, for hot plug event, do most users only
>>> want to listen to the hot-plug event of interested device? Or do
>>> they want to listen to all the hot-plug event of all USB device?
>> 
>> I would very much would like to be notified about any USB device
>> getting plugged in or unplugged.
> 
> Okay, let's wait and see if this will create overhead again just
> like the current enumeration process.
Yeah - I wouldn't worry about the performance of hotplug - hotplug events *typically* occur so infrequently that it's OK to process all devices (the tricky ones of course are when you have hubs plugged in/unplugged that have a lot of devices attached such as when you go to sleep/wake up).

-Vitali


More information about the libusbx mailing list