On Fri, 24 May 2013 10:53:22 -0600, Nathan Hjelm said:

>>> So the question then maybe if there are any apps doing hotplug already
>>> (and thus on
>>> their own) for darwin, if there are no such apps, then we may consider
>>> simply not
>>> fixing this under darwin.
>> 
>> I haven't followed this 'hotplugging' discussion much, and am not even
>sure if the term has some exact USB-specific meaning beyond the term's
>generic meaning, but anyway...
>> 
>> We use the OS X IOServiceAddMatchingNotification() API to watch for
>the plugging/unplugging of the vendor/product ID that we are interested
>in.  When the OS calls us back when a device is plugged in, we ask
>libusbx to reemumerate all devices.  It would be nice if we could just
>pass the new io_service_t to libusbx…
>
>1.2.0 will have a hotplug API so you won't need to do this yourself.
>Your app may not work as is with 1.2.0 due to a race between the darwin
>backend enumerating the device and your call to libusb_get_device_list()
>but I can fix it if there is a need.

A race internal to libusbx itself?  Sounds undesirable.  If I continue to use 
IOServiceAddMatchingNotification() myself, but don't actually call into libusbx 
as a response, that should be fine, yes?

In fact, I don't actually use libusbx directly at all, I use this, which in 
turn uses libusbx:

<https://github.com/labjack/exodriver>

Sounds like it may need updating for 1.2.

Is this hotplug API opt-in?  libusbx won't start observing the comings and 
goings of all USB devices by default I hope?

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 s...@rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to