-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TX message guaranteed delivery #421
Conversation
2ca5d60
to
fb9b709
Compare
Pretty sure this change also means that we need to add a timeout to the openpilot boardd code to prevent it from freezing if the CAN buffers are not cleared. |
For openpilot the most recent messages are more important, so it makes sense to drop older ones if the buffer overflows. I would like the to detect and log when this happens though! |
I was thinking we should set the timeout low (instead of 0) in boardd and then skip past messages that time out. |
If I understand correctly, that will result in the same behavior as we have right now? |
very close to the same since the ring buffer is pretty small (once a message is in the buffer it will always get sent); could also add an immediate NAK setting for OP but probably not necessary |
* wait for tx slots before clearing nak * fix bootstub * Fixed misra * Cleanup * Added bulk write test to test USB NAK on bulk CAN messages * Added automated bulk tx test * Fixed linter * Fixed latency test influence * Added timeout to python API * Disabled can write timeout in bulk write test Co-authored-by: Robbe <robbe.derks@gmail.com>
It is easy to overflow the TX buffer when sending a large number of messages rapidly. When sending UDS messages you don't want anything to get silently dropped. This change causes the client to pause (leave NAK active) until there is enough room in the TX buffer to process the next USB data packet. Not sure if this is desirable in all scenarios, or even if this is the right way to handle the situation, but it does seem to work.