Alex Rivera | Logout

libusb interface already claimed

Asked 2011-06-15T22:43:52.767
12

I'm writing a device driver for a usb device using libusb. When I attempt to claim the device I get the error code LIBUSB_ERROR_BUSY (-6). According to the documentation that means that the device has already been claimed (link).

How do I find out which driver/program has claimed the device and more importantly, how can I, myself, claim the device once it's claimed.

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
Edit
Report

1 Answer

19

Do you call libusb_detach_kernel_driver() before libusb_claim_interface()? This may be necessary.

answered 2011-06-25T06:24:32.703

Your Answer