问题
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