fix(mstp): Clause 9 CRCs + USB stream reassembly - #464
Closed
bbartling wants to merge 3 commits into
Closed
Conversation
Host async serial reads arrive in multi-millisecond chunks; treating inter-read gaps as Clause 9 T_frame_abort (~1.56ms @ 38400) discarded partial frames mid-assembly. Add decode_frame_stream (Complete/NeedMore/ Invalid), preserve trailing lone 0x55 on preamble miss, and replace wire T_frame_abort with a host stale-partial timeout based on max frame wire time plus USB scheduling slack. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace incorrect reflected polynomials (0xE0 / Modbus 0xA001) with Clause 9.6 values (0x81 / 0x8408). Add literal golden vectors including the live Token 0<-7 frame (CRC 0x37) and data frame 01 00 → 9F 16 so self-round-trip tests cannot mask interoperability failures. Co-authored-by: Cursor <cursoragent@cursor.com>
Move Clause 9 golden / stream tests into mstp_frame_tests.rs so mstp_frame.rs stays under the upstream file-size CI gate. Co-authored-by: Cursor <cursoragent@cursor.com>
2 tasks
Owner
|
Let me have my agent check this against my roadmap work for 1.0 and I'll get this rolled in! |
This was referenced Aug 30, 2026
Contributor
Author
|
Closing: keeping this work on the bbartling fork only ( |
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.
Summary
0x81/0x8408); prior0xE0/0xA001passed self-round-trip but rejected live trunk frames (e.g. Token55 FF 00 00 07 00 00 37).read()gaps as Clause 9T_frame_abort).0x55/0xF0B8).Commits
a9912b8fix(mstp): USB chunk gaps must not trigger T_frame_abort6a70b85fix(mstp): use BACnet Clause 9 header and data CRCsTest plan
cargo test -p bacnet-transport(343 unit + 2 integration)Made with Cursor