Exposing multiple sensors on a single device to Windows Sensor API

回眸只為那壹抹淺笑 提交于 2019-12-11 14:09:50

问题


Windows introduced the Sensor API so you can create a HID device that provides data for one of their 18 supported type of sensors. I'm creating a device that has many of those sensors on-board, but reading through the documentation it's not clear how to use it with a multiple sensors coming from one USB device. The only solution I can think of would be to let my device be a 'composite USB device', and simulate 18 different HID devices.

Is there a better way to support multiple sensors?


回答1:


You would support the HID protocol for sensors, and return a top level collection that comprises of multiple sensors.

See this whitepaper for details: http://msdn.microsoft.com/en-us/library/windows/hardware/br259128.aspx

Note that while the whitepaper refers to a sample HID sensors class driver, you don't have to implement a HID driver for sensors if you are on Windows 8 - Windows 8 ships with a HID sensors class driver.



来源:https://stackoverflow.com/questions/14325827/exposing-multiple-sensors-on-a-single-device-to-windows-sensor-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!