Main Site Documentation

Channel 9:Win 8.1 HID API


#1

API location: http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.humaninterfacedevice.aspx

Article API:

[quote]Prior to Windows 8.1, if you built a HID device, youd need to write a fairly substantial COM/Win32 desktop application to retrieve data from, or, to control your device. To get a sense of how youd do this, Microsoft provided the HClient application. If you knew COM, Win32, and C++, this app provided the starting point you needed. However, if you were a .Net programmer or a web developer, the ramp was pretty steep.

For Windows 8.1, Microsoft created the HID WinRT API. This new API lets you write Windows store apps in Javascript, C#, or C++ for a HID device. And, because youre creating store apps, they will run on your Surface or Surface Pro. (If youre an Android developer who created accessories and apps for your Nexus 7, you can now do similar things with the HID WinRT API and your Windows tablet.)

To illustrate the simplicity and power of the HID WinRT API, weve created a sample end-to-end solution. This solution includes plans for building a simple motion-sensor based on the Netduino Plus. When you attach this sensor to your tablet or laptop, and run the sample app, the app monitors the sensor and triggers a short video-capture whenever motion is detected. The solution includes both tutorials and source code.
[/quote]


#2

I saw this a couple of weeks ago when it posted, and have been thinking about using this. Don’t know a use yet but it seems cool :slight_smile: Actually I was thinking this might be a way of getting data into the PC instead of more traditional (Bluetooth) ways.


#3

As I understand WinRT HID is a high level API. It still needs a transport protocol. Bluetooth is on of them that WinRT HID can use.


#4

The scenario playing out in my mind is over USB, connect the device as a HID device with it’s own appropriate descriptor, then it becomes a custom “temperature and humidity” sender. Pretty dashboard app reading it.


#5

HID works over USB, i2c (not relevant for most people), Bluetooth, and Bluetooth LE.

If you want to use WinUSB-based comms (requires the device uses the WinUSB driver) you can do normal streaming.

You can also use RFCOMM and GATT with Bluetooth in 8.1

In all cases, if you have to install a custom driver, the solution will not work on Windows RT.

Pete