Hi,

On 03/22/2013 11:32 PM, Pete Batard wrote:
> On 2013.03.22 17:25, Ludovic Rousseau wrote:
>> Change: Auto detach is now fine for me.
>
> OK.
>
> I wasn't actually proposing such a change, since, unless somebody
> volunteers to create a patch,

I volunteer :)

> it's extremely unlikely that I'll have
> time to spend on that. At any rate, even if there's a volunteer, this
> will have to wait till after 1.0.15.

Agreed.

>
> And I agree that auto detach would be better opt-in than forced.

We all seem to agree on that, which is good :)  So it would be helpful
to get some feedback on my proposed API for the opting in before I
actually start coding this. Let me quote my own API proposal from
another mail:

Assuming all platforms will do auto-detach on interface claim (which
makes sense given that drivers are usually per interface), we could
make this a device_handle property, so then an app would do something
like:

libusb_device_handle *handle;

libusb_open(dev, &handle);
libusb_set_auto_detach(handle, 1);
libusb_claim_interface(handle, x);

With:
void libusb_set_auto_detach(libusb_device_handle *dev, int auto_detach);

This function would be available on all platforms and simple store
the setting in struct libusb_device_handle, and thus always succeed.
Interested backends can then get it from struct libusb_device_handle.

The documentation for this function will refer to
LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER and point out that on
platforms without that cap calling it is a nop.

Regards,

Hans

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to