views:

23

answers:

1

I have a Logitech game controller(http://www.amazon.com/Logitech-Dual-Action-Game-Pad/dp/B0000ALFCI). I'm using c# and Microsoft's HID driver to track what buttons are being pressed. Each button press sends a Byte Array that has 8 values. The problems is that I don't know what those 8 value represent. Here is an example:

0, 128, 126, 127, 130, 24, 24, 0, 4, 252
0, 128, 126, 127, 130, 40, 40, 0, 4, 252
0, 128, 126, 127, 127, 72, 72, 0, 4, 252
0, 128, 126, 127, 127, 136, 136, 0, 4, 252

Those are the values of the Byte Array for button press 1, 2, 3, 4 respectively. I see where the values are changing, but I'm unsure what they represent. I'm unable to find any specs on Microsoft HID driver. Can someone point me in the right direction?

A: 

You might want to use a USB traffic analyzer like http://www.usb-monitor.com/ to take a look at the input reports to see if that gives you any insight.

If you have the patience, the HClient sample program in the Windows Driver Kit has pretty much all the code to get and unpack the input reports from any HID device.

There are also some links here to some .Net USB libaries at Jan Axelson's Lakeview Research (on hidpage.htm), but I can't post that link because I've not got the rep yet.

These might implement some of the same code that is in HClient in C# rather than C++, though I have not confirmed this.

Charles