2011/3/15 Xiaofan Chen <xiaof...@gmail.com>: > 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. > You can do this through util.claim_interface function.
-- Best Regards, Wander Lairson Costa LCoN - Laboratório de Computação Natural - Natural Computing Laboratory (http://www.mackenzie.com.br/lcon.html) Programa de Pós-Graduação em Engenharia Elétrica (PPGEE) Faculdade de Computação e Informática (FCI) Universidade Presbiteriana Mackenzie - SP - Brazil ------------------------------------------------------------------------------ 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