Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hidapi libusb_claim_intetface return LIBUSB_ERROR_BUSY,but hid is not active #399

Open
Huimieer opened this issue Jun 28, 2018 · 0 comments

Comments

@Huimieer
Copy link

Huimieer commented Jun 28, 2018

the follow code snippet come from libusb/hid.c.
`res = libusb_open(usb_dev, &dev->device_handle);

/* Detach the kernel driver, but only if the device is managed by the kernel */
if (libusb_kernel_driver_active(dev->device_handle, intf_desc->bInterfaceNumber) == 1) {

res = libusb_detach_kernel_driver(dev->device_handle, intf_desc->bInterfaceNumber);

res = libusb_claim_interface(dev->device_handle, intf_desc->bInterfaceNumber);
if (res < 0) {...... }`

Description:
the problem is that libusb_claim_interface always return -6 after the libusb_open() has been excuted successfully.
but libusb_kernel_driver_active(dev->device_handle, intf_desc->bInterfaceNumber) don't equal to 1, so it won't do the detach operation. Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant