libusb_claim_interface在Mac OS X Mountain Lion上失败 [英] libusb_claim_interface fails on Mac OS X Mountain Lion

查看:605
本文介绍了libusb_claim_interface在Mac OS X Mountain Lion上失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了几个小时都没有结果.我到处都看到Mac OS X不支持libusb_detach_kernel_driver的情况,但是我找不到它的修补程序或替代方法.

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返回以下内容:libusb: 0.863377 error [darwin_claim_interface] USBInterfaceOpen: another process has device opened for exclusive access

如何将USB设备与内核分离?

How can I detach the USB device from the kernel?

推荐答案

许多设备自动将驱动程序连接到USB设备,OSX会将其识别为驱动程序,除非您强制系统执行以下操作,否则您将无法索取该设备.在运行代码并声明设备所有权之前,请先手动分离设备.例如,如果它将AppleUSBCDC设备连接到您插入的某些独特的USB设备,则必须执行以下操作:

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.

这篇关于libusb_claim_interface在Mac OS X Mountain Lion上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆