当前位置: 动力学知识库 > 问答 > 编程问答 >

winapi - Exposing multiple sensors on a single device to Windows Sensor API

问题描述:

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?

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: