Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 3 months ago.
Is hid.readNB() reading the most recent message or from a queue?
I'm developing a device which is both input (joystick postion) and out (force vector). I just got the communication working (thanks for the nice starter code!).
If I keep sending messages from the computer in a while(1) loop, am I receiving the most recent value or the oldest in a queue? And in the same way, am I sending out in a queue or just overwriting a buffer the pc can read whenever and as often as it wishes?
To be clear, I don't really care if messages are lost, i'm just interested in the most recent values from both sides.
I'm using the hidapi c bindings, in windows 7 64 bit (and linux), transmitting a struct of 48 bytes.
Best regards Jonas