- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am implementing a simple USB command response interface for the PsoC 4 board I designed. I have it working but only through a nasty workaround.
In the CyUSB,NET document it states that ReadInput() will indefinitely hang until a input report is received. I immediately noted that it
does not hang but simply reports a packet of all zeroes. To make it work I had to add a Thread sleep of 16 or greater ms after the WriteOutput() function
sends a command. My device has a generic HID interface with 8 byte packets. This fix is problematic because of varying times for the device
to send it's response. Sometimes, I have to wait 32, 48 or even 64ms to receive a valid response.
Why does ReadInput() not block as stated ? Also, is there another function I can call to guarantee the response packet has been received before I post
a ReadInput() ? I noticed there is a WaitForXfer function in the EndPoint class hierarchy. But nothing like that for CyHIDDevice.
Regards,
Chuck