todbot / blink1

Official software for blink(1) USB RGB LED by ThingM
https://blink1.thingm.com/
Other
953 stars 237 forks source link

FeatureReportByteLength of blink(1) is 9 instead of 8 #675

Open kissfrog opened 10 months ago

kissfrog commented 10 months ago

Tried to get caps via HidP_GetCaps API on Windows, and it turned out that FeatureReportByteLength is 9, which is different from the doc:

The blink(1) feature report packet is 8 bytes long.

Why?

todbot commented 10 months ago

HID reports with Report IDs are one byte bigger than what's in the HID Report Descriptor, in order to hold the Report ID.

kissfrog commented 10 months ago

HID reports with Report IDs are one byte bigger than what's in the HID Report Descriptor, in order to hold the Report ID.

But as per your document, the first byte is also already report_id:

- byte 0 = 0x01  (report_id )
- byte 1 = 'c'   (command "fade to rgb")
- byte 2 = red value
- byte 3 = green value
- byte 4 = blue value
- byte 5 = th    (fadeMillis/10 high byte)
- byte 6 = tl    (fadeMillis/10 low byte)
- byte 7 = ledn  (unused on mk1, 0=all on mk2) 

So actually the byte 8 exists, but always set as 0?

kissfrog commented 10 months ago

And what's the HID Report Descriptor part of blink(1)? From byte 1 to byte 8 (and the byte 8 is omitted)?