On Tue, Mar 15, 2011 at 10:55 PM, Emmanuel Blot <eblot...@gmail.com> wrote:
> I need to detach *all* the interfaces from the (Linux) kernel, or I
> sometime get an error (not a big deal for my use case)
> I also need to call dev.set_configuration() to configure the device.
> Nothing unusual I guess.
>
> The troubles happen when I need to open two serial ports, that is two
> interfaces from the same USB device.
> On the second initialization call, when dev.set_configuration() is
> called for the second time, the first open interface gets in trouble:
>  Exception: UsbError: No such device (it may have been disconnected)
> It seems set_configuration() cannot be called another time if an
> interface is already being actively used.
>
> I don't know how to avoid calling set_configuration() more that once,
> as I don't know how to identify that the USB device has already been
> configured.
>

You can call  set_configuration() once and then call claim_interface
for each interface. At least this is how libusb works for USB composite
device.

-- 
Xiaofan

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to