-
Notifications
You must be signed in to change notification settings - Fork 111
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
Disallow SOF in messages to handle mid-message death #16
Comments
It's a good idea, I'm only concerned about back compat. If you add it, please make it configurable, so it can be switched off. |
I might be missing something, but wouldn't a simple back compatible way be to:
This way the state machine will resynchronise on the next valid checksum/crc with no change to the message structure Edit: |
@grantramsay Sounds reasonable to me, this resyncing will work. I'd gladly merge that. (I don't currently use TF in any active project, so I don't see implementing this myself soon..) |
That would actually be quite an elegant solution, I might try implementing that |
@mon - I had a little go at this the other day. |
Hmmm, certainly a little more complex than I expected. I'll experiment a bit over the next few weeks and see how reliable it is. |
…g-of-undefined-claimtx-and-releasetx 15 correct handling of undefined claimtx and releasetx
If one side of the communications dies mid-transfer, it could get "out of sync" with the state machine's idea of what things should look like.
One approach could be to have a SOF byte and an escape byte. If either of those bytes need to appear in the stream, send the escape byte and invert the bits of the required byte.
Thus, if you receive a SOF mid-message, you know the message is bad and to restart the state machine.
Thoughts?
The text was updated successfully, but these errors were encountered: