tags:

views:

279

answers:

4

Is there an API in .NET (C#) for using USB HID (Human Interface) devices?

A: 

I suggest you start here: http://wiimotelib.codeplex.com/

unclepaul84
Why? A Nintendo Wiimote library!?
jco
Because the Wiimote is a HID device under windows, and that codeplex project has all the p/Invoke work needed to communicate with a HID device from the CLR done for you in the HDImports class
squig
This doesn't answer the question.
Dark Star1
+2  A: 

There's nothing direct or high-level. There are some things you can do through the managed WMI API, but I've personally found a lot of WMI interaction with hardware to be cryptic at best and requiring a lot of trial-and-error to get it to do what you want. Someone on CodeProject has developed a .NET component for USB HDI you can try out that's probably going to fit the bill better than WMI.

Tim Trout
A: 

I would suggest you follow link text instead. It was invaluable in getting me up and running with HiD dev in C#.

Dark Star1
A: 

HidLibrary wraps up all the P/Invoke calls for you. But no it doesn't look there is any nice framework APIs for dealing with USB devices.

karnqu