我搜索了几个小时都没有结果。我到处都看到 Mac OS X 不支持 libusb_detach_kernel_driver
,但我没能找到它的补丁或替代方案。
libusb_claim_interface
返回:libusb: 0.863377 error [darwin_claim_interface] USBInterfaceOpen: another process has device opened for exclusive access
如何从内核中分离 USB 设备?
最佳答案
许多设备自动将驱动程序附加到 USB 设备,它们被 OSX 识别为您将无法声明该设备,除非您强制系统手动分离该设备,然后才能运行您的代码并声明该设备.例如,如果它将 AppleUSBCDC 设备连接到您插入的某个独特的 USB 设备,您必须执行以下操作:
sudo kextunload -b com.apple.driver.AppleUSBCDC
在运行尝试声明接口(interface)的应用程序之前。
关于c - libusb_claim_interface 在 Mac OS X Mountain Lion 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15102168/