From: David L. <dav...@le...> - 2017-03-17 14:53:25
|
Hello, New user of libusb so I might be missing something important in the usage, but I have an error when trying to use libusb_bulk_transfer to read data from the device. It gives me LIBUSB_ERROR_IO. I enabled debug to level 4, and I think the issue is on this line : libusb: debug [reap_for_handle] urb type=3 status=-62 transferred=0 But I cant find any information about what that -62 means. The code works on win7 64 bits and I have the issue on debian 64 bits. Here is the usb functions I use before the crash : libusb_init(&mContext) libusb_set_debug(mContext, 4); libusb_get_device_list(mContext,lList) libusb_get_bus_number( lList[ i ] ) libusb_open( lList[ i ], &mHandle ) libusb_claim_interface( mHandle, 0 ) libusb_free_device_list( lList, true ); libusb_control_transfer( mHandle, aRequestType, aRequest, 0, 0, lBuffer, 500, aTimeout ) libusb_bulk_transfer( mHandle, aEndPoint, ( unsigned char * )aData, aSize, &lLen, mWriteTimeout ) libusb_bulk_transfer(mHandle, aEndPoint | LIBUSB_ENDPOINT_IN, aData, aSize, &lLen, mReadTimeout) and the debug output : [ 0.335281] [00000948] libusb: debug [libusb_get_device_list] [ 0.335299] [00000948] libusb: debug [libusb_open] open 1.3 [ 0.335309] [00000948] libusb: debug [usbi_add_pollfd] add fd 15 events 4 [ 0.335314] [00000948] libusb: debug [libusb_claim_interface] interface 0 [ 0.335327] [00000948] libusb: debug [add_to_flying_list] arm timerfd for timeout in 1000ms (first in line) [ 0.335357] [00000948] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [ 0.335359] [00000948] libusb: debug [handle_events] poll() 4 fds with timeout in 60000ms [ 0.335437] [0000094d] libusb: debug [linux_udev_event_thread_main] udev event thread entering. [ 0.346785] [00000948] libusb: debug [handle_events] poll() returned 1 [ 0.346803] [00000948] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=232 [ 0.346806] [00000948] libusb: debug [handle_control_completion] handling completion status 0 [ 0.346808] [00000948] libusb: debug [disarm_timerfd] [ 0.346810] [00000948] libusb: debug [usbi_handle_transfer_completion] transfer 0x6627f0 has callback 0x7ffff7bce1d0 [ 0.346812] [00000948] libusb: debug [sync_transfer_cb] actual_length=232 [ 0.346907] [00000948] libusb: debug [add_to_flying_list] arm timerfd for timeout in 1000ms (first in line) [ 0.346929] [00000948] libusb: debug [submit_bulk_transfer] need 1 urbs for new transfer with length 8 [ 0.347013] [00000948] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [ 0.347016] [00000948] libusb: debug [handle_events] poll() 4 fds with timeout in 60000ms [ 0.348967] [00000948] libusb: debug [handle_events] poll() returned 1 [ 0.348992] [00000948] libusb: debug [reap_for_handle] urb type=3 status=0 transferred=8 [ 0.348995] [00000948] libusb: debug [handle_bulk_completion] handling completion status 0 of bulk urb 1/1 [ 0.348997] [00000948] libusb: debug [handle_bulk_completion] last URB in transfer --> complete! [ 0.348999] [00000948] libusb: debug [disarm_timerfd] [ 0.349002] [00000948] libusb: debug [usbi_handle_transfer_completion] transfer 0x668fc0 has callback 0x7ffff7bce1d0 [ 0.349003] [00000948] libusb: debug [sync_transfer_cb] actual_length=8 Here I call the libusb_bulk_transfer that crash [10.693017] [00000948] libusb: debug [add_to_flying_list] arm timerfd for timeout in 1000ms (first in line) [10.693045] [00000948] libusb: debug [submit_bulk_transfer] need 1 urbs for new transfer with length 16 [10.693109] [00000948] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling [10.693115] [00000948] libusb: debug [handle_events] poll() 4 fds with timeout in 60000ms [10.695124] [00000948] libusb: debug [handle_events] poll() returned 1 [10.695153] [00000948] libusb: debug [reap_for_handle] urb type=3 status=-62 transferred=0 [10.695159] [00000948] libusb: debug [handle_bulk_completion] handling completion status -62 of bulk urb 1/1 [10.695164] [00000948] libusb: debug [handle_bulk_completion] low level error -62 [10.695168] [00000948] libusb: debug [disarm_timerfd] [10.695174] [00000948] libusb: debug [usbi_handle_transfer_completion] transfer 0x668fc0 has callback 0x7ffff7bce1d0 [10.695179] [00000948] libusb: debug [sync_transfer_cb] actual_length=0 Thanks, David |