使用 C# 在 Windows CE 6.0 中使用 USB HID 设备
我正在开发一个嵌入式 Windows CE 项目,并且有兴趣通过一个访问 USB HID 设备其 USB 主机端口。我真正需要阅读的是原始 HID 规范数据包。
在 Windows 计算机上,我有一个使用 hid.dll 的工作程序,但据我研究,Windows CE 上没有任何等效程序。我知道有 usbhid.dll 文件,但我不确定它是否适用于这种情况。我不想编写内核级驱动程序,因为我想用 C# 进行编码。如何在 Windows CE 上使用 HID 设备?
I am working on an embedded Windows CE project and am interested in accessing a USB HID device through one of its USB Host ports. All I really need to read are the raw HID specification packets.
On a Windows computer, I have a working program using hid.dll, but as far as I have researched, there isn't any equivalent on Windows CE. I know there is the usbhid.dll file, but I'm not sure if it is applicable for this situation. I would prefer not to write a kernel level driver, as I would like to do my coding in C#. How can I make consuming an HID device on Windows CE work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对 HID 没有具体的经验,但使用适当的驱动程序 DLL(设备制造商可能有一个)将 USB 端口作为 COM 端口访问可能会有所帮助。理论上,您应该能够使用
SerialPort
类以这种方式接收设备的原始数据包。I have no concrete experience with HID, but accessing the USB port as a COM port with a proper driver DLL (the device manufacturer might have one) might help. Theoretically you should be able to receive the device's raw data packets with a
SerialPort
class that way.Toradex 以开源方式发布了其 USB 传感器和外围设备。
这些传感器是 HID 设备,免费提供的源代码包含 Windows CE 上的 C# 和 Visual Basic 示例。
Oak 传感器和接口
Toradex released their USB sensors and peripherals as open source.
The sensors are HID devices and the freely available source code does include samples for C# and Visual Basic on Windows CE.
Oak Sensors and Interfaces