Libusb interface has already been announced

I am writing a device driver for a usb device using libusb. When I try to request a device, I get the error code LIBUSB_ERROR_BUSY (-6). According to the documentation, which means that the device has already been declared ( link ).

How to find out which driver / program announced the device, and more importantly, how can I request the device myself after it is approved.

Code snippet:

r = libusb_claim_interface(handle[0], 0); if (r < 0) { fprintf(stderr, "libusb_claim_interface error %d\n", r); goto out_release; } printf("claimed interface\n"); 

Output:

 libusb_claim_interface error -6 
+8
linux usb driver libusb
source share
3 answers

Do you call libusb_detach_kernel_driver() to libusb_claim_interface() ? It may be necessary.

+10
source share

The problem is most likely related to the interface of another Linux driver. call libusb_detach_kernel_driver() and specify the interface number, and then you can connect it.

+1
source share

Did you call libusb_set_configuration() before libusb_claim_interface() ?

This must be called even if there is only one configuration in the descriptor.

0
source share

All Articles