Closed jrcutler closed 12 years ago
Do we necessarily want to kill the entire read thread if just one input transfer fails? What is the case in which you are seeing this?
I have found that one process opening a device will disrupt another process that already has the device open (under Linux/libusb). If I do not terminate the thread after the error, I often find the device in an unusable state. Conversely, if I do terminate the thread and reopen, the device seems to remain functional. (The device in question is a FUNcube Dongle Pro.)
Unfortunately, opening a device a second time causes problems. I'm working with the libusb maintainer to come up with a better solution, however LIBUSB_TRANSFER_ERROR isn't the right thing to key on because there are other situations which give this error which are recoverable. I'll let you know soon.
Check out: 1bde0321709c8a15d5623f599dc43e
I think this will do what you're looking for.
This works as expected.
The read callback will currently hang if a transfer status of
LIBUSB_TRANSFER_ERROR
occurs. There is a simple fix.