简体   繁体   中英

libusb_claim_interface fails on Mac OS X Mountain Lion

I've searched for hours with no avail. I've seen it everywhere that libusb_detach_kernel_driver isn't supported on Mac OS X, but I haven't been able to find a patch or alternative for it.

libusb_claim_interface returns this: libusb: 0.863377 error [darwin_claim_interface] USBInterfaceOpen: another process has device opened for exclusive access

How can I detach the USB device from the kernel?

Many devices automatically have a driver attached to the USB device they are recognised as by OSX and you will not be able to claim the device unless you force the system to detach the device manually before you can run your code and claim the device. If for example it attached the AppleUSBCDC device to some unique usb device you plugged in you'd have to do:

sudo kextunload -b com.apple.driver.AppleUSBCDC

before running your application which tries to claim the interface.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM