OSX将产品ID更改为USB复合设备

时间:2014-09-23 11:36:42

标签: macos usb iokit

我需要在MAC OSX下使用复合USB设备。在Linux下,我可以使用usb_modeswitch工具使用以下命令更改产品ID

usb_modeswitch -v 0x072f -p 0x100d -V 0x072f -P 0x90cc -m 0x2 -M01b0000000000000000000000000000000000000000000000000000000000000 -r 1 -Q

我尝试在OSX 10.9.5下使用libusb成功构建相同的工具但是当我运行应用程序时,我获得了此处报告的问题 Unable to claim USB interface with C + libusb on Mac OS X。建议的解决方案对我不起作用,因为我无法为我的设备找到/ dev /条目。

所以我正在尝试使用类似

之类的内容Working With USB Device Interfaces报告的代码
IOUSBDevRequest     request;

request.bmRequestType = USBmakebmRequestType(kUSBOut, kUSBVendor, kUSBDevice);
request.bRequest = 0x02;
request.wValue   = deviceAddress;
request.wIndex   = 0;
request.wLength  = length;
request.pData    = writeBuffer;

return (*dev)->DeviceRequest(dev, &request);

但无论如何我得到这个错误0xe000404f(似乎是kIOUSBPipeStalled)。这是代码,我不确定它,我需要复制usb_modeswitch命令。

code

任何帮助都将不胜感激。

0 个答案:

没有答案