Uwe,
On Tuesday, 4. October 2011 14:37:48 Uwe Bonnes wrote:
> + if (ftdi->usb_dev != NULL)
> + {
> + if ((ftdi->index != interface) && ((ftdi->index == INTERFACE_A)
> && (interface != INTERFACE_ANY))) +
> + ftdi_error_return(-3, "Interface can not be changed on an
> already open device"); + }
Hmm, what about this:
- ftdi_set_interface(INTERFACE_B);
- ftdi_usb_open()
- ftdi_set_interface(INTERFACE_A);
That won't be caught by the code above.
What about simplifying it to:
"if (ftdi->usb_dev && ftdi->index != interface)"
or does that break a valid use case?
Cheers,
Thomas
--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
|