libusb
libusb copied to clipboard
Interrupt_Transfer not usable
The current implementation of Interrupt_Transfer returns:
if rc != 0 {
return nil, &libusb_error{rc}
}
return data[:int(transferred)], nil
If libusb can only perform a partial transfer then rc will be -7 (LIBUSB_ERROR_TIMEOUT) but transferred will be a positive integer. The caller to the go implementation will recieve a nil []byte and a timeout error but no indication that anything was transferred.
This makes interrupt I/O practically impossible when the data sent/read is broken up into smaller packets and transferred piece-meal because the caller will never know that anything was sent or read.