PDA

View Full Version : EasyHID and buffer entry 0



Demon
- 19th August 2006, 20:34
There is some confusion as to what this byte really is. In USB, byte 0 is reserved for the report. But in the PBP generated code by EasyHID, it is the first available data element. I just did a test using AnyHID and intercepted the USB packet directly in Windows.

This test was done with a buffer defined as 1 byte in EasyHID. The PBP generated code has an array defined with 2 element; 0 and 1.

If I do this in PBP:
USBBuffer [0] = 98
USBBuffer [1] = 99

I get this in the USB buffer once on PC:
Report Buffer:
===========================
Byte No. Hex = Binary
000 0x00 = 00000000
001 0x62 = 01100010 (binary 98)

So you have to place your data in element 0 in PBP, anything in element 1 will be truncated. It will then arrive on the PC in element 1.

Robert
:)