升级10.11的osx驱动程序(USB堆栈中的更改) [英] Upgrading osx driver for 10.11 (Changes in USB stack)

查看:114
本文介绍了升级10.11的osx驱动程序(USB堆栈中的更改)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将现有的自定义鼠标驱动程序设备升级到OSX 10.11.可以看出苹果已经更新了其USB堆栈.

I am upgrading existing custom mouse driver devices to OSX 10.11. It is seen that apple has updated its usb stack.

请参考- https://developer .apple.com/library/mac/releasenotes/General/APIDiffsMacOSX10_11/Objective-C/Kernel.html

我现有的代码使用了许多已删除的类(IOUSBHIDDriverIOUSBInterfaceIOUSBPipe等).有人可以帮助我寻找替代品或任何有用的信息以升级到10.11吗?

My existing code uses many of the removed classes (IOUSBHIDDriver, IOUSBInterface, IOUSBPipe etc). Can someone help me in finding replacements or any useful information for upgrading to 10.11?

许多类和头文件都被重命名了,我可以从上面的链接中找出替换的内容.但是代码也使用不推荐使用的类IOUSBPipe及其方法.我还没有完全了解它的用途.有人可以解释IOUSBPipe的目的,也可以向我建议OSX 10.11的替代类吗?

Many classes and header files are renamed, and I can figure out the replacements from the above link. But code also uses deprecated class IOUSBPipe and its methods. I have not fully understood what it is used for. Can someone explain purpose of IOUSBPipe as well as suggest me the alternative class for OSX 10.11?

请在此行下面找到处理IOUSBpipe

Please find below this line a code snippet that deals with 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]);
}

推荐答案

管道基本上代表USB端点的一个方向.您可以从中发送或接收数据.我对Mac OS X中的内核级开发了解不多,但是通过查看

A pipe basically represents one direction of a USB endpoint. You can send or receive data from it. I don't know much about kernel-level development in Mac OS X, but by looking at the document you posted, I suspect you are supposed to use IOUSBHostPipe now instead of IOUSBPipe.

这篇关于升级10.11的osx驱动程序(USB堆栈中的更改)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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