nyholku/purejavahidapi — pull request #4 by luciano-schirmer (2014-11-19 02:12:02+00:00)
Title: Fix issue #2 from nyholku/purejavahidapi

As stated in the linux kernel [hidraw documentation](https://www.kernel.org/doc/Documentation/hid/hidraw.txt):

> "The first byte of the buffer passed to write() should be set to the report
> number. If the device does not use numbered reports, the first byte should
> be set to 0. The report data itself should begin at the second byte."

The problem is when your first data byte is a `0`, the HID device will think this byte is the Report Id and ignore it. So the second byte in the buffer (which is actually the second data byte) gets interpreted as the first data byte and so on.

Another good reference is the [USB Device Class Definition for Human Interface Devices (HID)](http://www.usb.org/developers/hidpage/HID1_11.pdf) guide, section 5.6 Report.

I changed the code to allways pass the Report Id or `0` if not using numbered reports.

I tested and it works fine now.