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]);
}