Repository navigation
HDLC and OverAscii: test against the firmware's framing vectors, and match it - #35
Merged
Merged
Conversation
…match it Tested against RaftCore's shared hdlc_vectors.json and overascii_vectors.json (made from the firmware's MiniHDLC and ProtocolOverAscii), which found: - An escape just before a flag carried over into the next frame, corrupting its first byte so that frame was lost. A flag now ends the escape, as in the firmware. - The encoder's buffer (2n+4) was too small when every payload byte and both CRC bytes are escaped (2n+6), so Uint8Array.set threw. - A frame whose payload is empty (2 CRC bytes) was ignored; the firmware delivers it (RaftMsgHandler counts it as too short). - WebSerial logged only the first complete console text line in a received chunk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests raftjs's HDLC and OverAscii framing against the shared vectors that RaftCore makes from the firmware's own
MiniHDLCandProtocolOverAscii(robdobsn/RaftCore#54), and fixes what they found.Fixes
Uint8Array.setthrew.Tests
src/RaftCommsFramingVectors.test.tsruns the vectors intestdata/hdlc_vectors.jsonandtestdata/overascii_vectors.json. These are copies of RaftCore'sscripts/tests/files and are identical to the ones now on RaftCoremain. After an intended framing change, regenerate them in RaftCore with./test_comms_framing_vectors --writeand copy them here.🤖 Generated with Claude Code