API for hotplug (was Re: ETAs for libusbx operability and first release?)

Pete Batard pete at akeo.ie
Wed Feb 1 11:25:08 EST 2012


On 2012.02.01 16:00, Vitali Lovich wrote:
>> Currently an app using libusb won't notice an unplug *at all* until it
>> tries to submit some new IO to the device. So for some apps the delay
>> may be quite large.
> Unless it polls the list of devices, which is the way I do it.  Additionally, I poll the list only on hotplug notifications.  It's hacky, but it works fine for the most part.

Yeah, feature complete hotplug could leveragee async event notification, 
which we don't have an official cross-platform solution for at the moment.

The proposal from Nokia, which is the one I used in my hp branch does 
even handling with a listener callback:

http://git.libusb.org/?p=libusb-pbatard.git;a=commitdiff;h=6cb025b4c853f2c034f72e12b1ab243d9d6e2a59;js=1#patch4

Remember that you can already have a look at an hp proposal if you are 
interested. See the commits after pbh310 at [1]

Regards,

/Pete

[1] 
http://git.libusb.org/?p=libusb-pbatard.git;a=shortlog;h=refs/heads/hp;js=1



More information about the libusbx mailing list