[英]What's the best way to determine if a HID device driver can be written in user space on OSX?
I need to write a number of drivers for both HID USB devices as well as some old serial devices. 我需要为HID USB设备和一些旧的串行设备编写许多驱动程序。 The drivers are to pull data off the device and then send the data over to an application that then consumes it. 驱动程序要从设备中提取数据,然后将数据发送到应用程序,然后再使用它。 Since the Apple Docs mention that a lot of USB and HID communication can be done from the user space I had assumed that I would not need to write a kernel extension, at least not for the HID devices. 由于Apple Docs提到可以从用户空间完成许多USB和HID通信,所以我假设我不需要编写内核扩展,至少对于HID设备而言不需要。 Could some one tell me a more solid way to determine this? 有人可以告诉我一种更可靠的方法来确定这一点吗?
Thanks! 谢谢!
If you're writing a single application that must talk to one or more USB HID devices you may well find you can just access the devices straight from the application using the application-level USB APIs. 如果您正在编写一个必须与一个或多个USB HID设备通信的应用程序,则可能会发现您可以使用应用程序级USB API直接从该应用程序访问这些设备。
A kernel driver would be more for something like a networking or mass storage device that needed to integrate with the kernel to be be available to multiple applications. 内核驱动程序将更多地用于网络或大容量存储设备等需要与内核集成以便可用于多个应用程序的设备。
This Apple document Common QA and Roadmap for USB Software Development on Mac OS X goes into some detail on the matter and links to example code too. 此Apple文档在Mac OS X上进行USB软件开发的Common QA和Roadmap对此事进行了详细介绍,并也链接到示例代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.