Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libusb: remove the timeouts in hid_write()
The libusb/hid.c:hid_write() has timeouts in its calls to libusb_interrupt_transfer and libusb_control_transfer(). This timeout can sometimes be tripped (e.g., if the underlying hardware is slow), and no sensible error code is returned -- you just get a -1. Hence, the caller can't know that it could just try again because the only error that occurred was a timeout (or that the message may have actually gotten through). Additionally, the other hid.c:hid_write() implementations -- linux, mac, and windows -- are all blocking and do not timeout. This makes the behavior of the libusb hid_write() different than the others, which seems weird. This commit simply sets the libusb timeouts to 0 (i.e., infinite) to make the libusb hid_write() behave like the others.
- Loading branch information