Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wondering about libusb_bulk_transfer error code

Tags:

return

libusb

libusb_open(device, &deviceHandle);

returns 0

but

libusb_bulk_transfer(deviceHandle, 0x81, data1, 512, &len, 0);

return -5

so I try to find error code -5 using printf

LIBUSB_ERROR_TIMEOUT
LIBUSB_ERROR_PIPE
LIBUSB_ERROR_OVERFLOW
LIBUSB_ERROR_NO_DEVICE
LIBUSB_ERROR_IO
LIBUSB_TRANSFER_ERROR
LIBUSB_ERROR_INTERRUPTED
LIBUSB_ERROR_ACCESS
LIBUSB_ERROR_BUSY
LIBUSB_ERROR_NO_MEM
LIBUSB_ERROR_COUNT
LIBUSB_ERROR_INVALID_PARAM

But none... and can't find anywhere in google...

What's the meaning of error code -5 in libusb_bulk_transfer?

Help me!

like image 417
user3329872 Avatar asked Mar 20 '23 05:03

user3329872


1 Answers

LibUSB error codes can be found in the libusb documentation, which is available online here.

The functions libusb_error_name and libusb_strerror can also be used to get a string corresponding to the error code. -5 is LIBUSB_ERROR_NOT_FOUND : Entity not found.

Google suggest checking that you have successfully claimed the interface (you must claim the interface you want to use, with libusb_claim_interface before doing IO).

like image 59
Leiaz Avatar answered Apr 27 '23 15:04

Leiaz