1
我正在将现有的自定义鼠标驱动程序设备升级到OSX 10.11。据了解,苹果已经更新了它的USB堆栈。为10.11升级osx驱动程序(USB堆栈中的更改)
我现有的代码使用了很多的去除类(IOUSBHIDDriver
,IOUSBInterface
,IOUSBPipe
等)。有人可以帮我找到更新或任何有用的信息升级到10.11?
许多类和头文件被重命名,我可以从上面的链接中找出替换。但代码也使用不推荐的类IOUSBPipe
及其方法。我还没有完全明白它的用途。有人可以解释IOUSBPipe
的目的,并建议我的OSX 10.11的替代类?
请找到下面这行代码段与IOUSBpipe
IOMemoryDescriptor *report;
setReport(report, kIOHIDReportTypeOutput);
IOReturn ret;
IOUSBDevRequest request;
IOUSBFindEndpointRequest findRequest = {
kUSBAnyType,
kUSBAnyDirn,
0,
0
};
IOUSBPipe *pipe = NULL;
while(pipe=usbInterface->FindNextPipe(pipe, &findRequest))
{
if (!pipe)
{
IOLog("NO PIPE!\n");
return 0;
}
IOLog("control request on pipe!\n");
request.bmRequestType = (UInt8)req->bmRequestType;
request.bRequest = (UInt8)req->bRequest;
request.wIndex = (UInt16)req->wIndex;
request.wLength = req->wLength;
request.wValue = (UInt16)req->wValue;
request.pData = (void*)data;
pipe->ControlRequest(&request);
IOLog("result: %d", data[0]);
}