Kaspar,
> What is that last byte used for? I was going just going to make the
> GENERIC_REPORT_SIZE the same as the HID IN and OUT endpoints size
> (both 64 bytes).
The last (actually first) byte is used by the PC to tell the device
what report ID the data is being directed to. The HID protocol allows
for multiple different reports to be multiplexed through the same
physical endpoint (see the KeyboardMouse device demo) by assigning
each report a non-zero unique ID, and then prefixing reports with that
ID. This means that for a 64 byte endpoint, the first byte will
contain the report ID and the remaining data will belong to that
report.
If no report IDs are specified the host will assume that there is only
one report with ID 0x00.
> Thinking about this a bit further, say the endpoint size is 64 bytes
> and the GENERIC_REPORT_SIZE is 4 bytes. Are they overwritten after 16
> messages or are they overwritten after just 1?
Just one. HID reports are volatile and single buffered by design, so
that new report data immediately succeeds old data.
Cheers!
- Dean
> I work with Liam and I am just looking at theseHIDwoes again. I am
> re-designing our protocol to make efficient use of the endpoint size.
> You said:
>
> >GENERIC_REPORT_SIZE reports in both directions, and make sure that GENERIC_REPORT_SIZE is less than the endpoint size by at least one byte just to keep things simple.
>
> What is that last byte used for? I was going just going to make the
> GENERIC_REPORT_SIZE the same as theHIDIN and OUT endpoints size