I declared two input reports (64B for the short report and 128B for the long report) with a 64B interrupt endpoint in packet size.
When reading the short report, the USB analyzer shows the expected number of bytes (64B) for the short report as being transferred, but ReadFile complains that my buffer is invalid (although it is large enough and numberOfBytesToRead = 64).
If I use the long report size for the numberOfBytesToRead parameter on the short report, ReadFile does not complain, but this is useless and clearly wrong. How can I fix this?
And I used multiples of interrupt endpoint in packet size to make things simple; what happens if my reports are not multiples?
I read that I need to use ZLP or short packet at the end of short reports because the HID driver expects reports of the longest size. So this is likely the problem. Is there an example of how to make ZLP in the SiLabs firmware? I am using the C8051F320.
Need to send a ZLP after the short reports if they are multiples of endpoint in packet size.