I'm using an at90usb1287 in my LUFA based project as a raw hid device.
It's communicating with a custom C# .net app and I have following issues:
- Sometimes some packets gets lost. Host app asks the device for data and every now and then the response doesn't get to the host. I know it has been sent from the device because I enumerate the device as a CDC as well for debugging and tracing sent message.
I thought it may be related with the poll interval so I tried anything from 5ms to 150ms but it's the same.
Should I add safe mechanism of re-sending the packet when the host doesn't confirm receiving it or LUFA handles it but there is something wrong?
- I added unique id to each poll command to trace the order of messages for debugging and I noticed weird behavior. I always send a command asking for data and immediately after (when success) asking for the response data. What is weird that the response is always coming back 16 requests later.
Let's say I send a command with id=1 and I know that the device answered with some data. However the immediate response is empty. It will arrive back to host 16 tries later with the id=17. Is it normal?
I'm using this library for HID communication on the C# side, but I suppose it's irrelevant: