Refactor frame formats to two-level architecture (Basic/Tiny/None + PayloadTypes) - #67
Conversation
- Restructure frame formats to Basic (2 start bytes), Tiny (1 start byte), None (0 start bytes) - Define new payload types: Minimal, Default, ExtendedMsgIds, ExtendedLength, Extended, SysComp, Seq, MultiSystemStream, ExtendedMultiSystemStream - Update start byte scheme: Basic starts at 0x90, 2nd byte at 0x70+offset; Tiny uses 0x70+offset - Update frame_format.py to recognize new header fields (sequence, system_id, component_id, package_id) - Regenerate boilerplate files for all languages - Update framing.md documentation with new architecture - Update README.md with new frame format documentation Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
Use LEN16 notation consistently for 2-byte length fields in payload type comments Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
| |-------------|--------|---------------------------|-------------------| | ||
| | Minimal | 0 | 0x70 | `[MSG_ID] [PACKET]` | | ||
| | Default | 1 | 0x71 | `[LEN] [MSG_ID] [PACKET] [CRC1] [CRC2]` | | ||
| | ExtendedMsgIds | 2 | 0x72 | `[PKG_ID] [LEN] [MSG_ID] [PACKET] [CRC1] [CRC2]` | |
There was a problem hiding this comment.
[LEN] [PKG_ID] [MSG_ID] [PACKET] [CRC1] [CRC2] |
There was a problem hiding this comment.
Fixed in 97cf139. Updated field order to [LEN] [PKG_ID] [MSG_ID] in ExtendedMsgIds format.
| | Default | 1 | 0x71 | `[LEN] [MSG_ID] [PACKET] [CRC1] [CRC2]` | | ||
| | ExtendedMsgIds | 2 | 0x72 | `[PKG_ID] [LEN] [MSG_ID] [PACKET] [CRC1] [CRC2]` | | ||
| | ExtendedLength | 3 | 0x73 | `[LEN_LO] [LEN_HI] [MSG_ID] [PACKET] [CRC1] [CRC2]` | | ||
| | Extended | 4 | 0x74 | `[PKG_ID] [LEN_LO] [LEN_HI] [MSG_ID] [PACKET] [CRC1] [CRC2]` | |
There was a problem hiding this comment.
[LEN_LO] [LEN_HI] [PKG_ID] [MSG_ID] [PACKET] [CRC1] [CRC2]
There was a problem hiding this comment.
Fixed in 97cf139. Updated field order to [LEN_LO] [LEN_HI] [PKG_ID] [MSG_ID] in Extended format.
| | SysComp | 5 | 0x75 | `[SYS_ID] [COMP_ID] [LEN] [MSG_ID] [PACKET] [CRC1] [CRC2]` | | ||
| | Seq | 6 | 0x76 | `[SEQ] [LEN] [MSG_ID] [PACKET] [CRC1] [CRC2]` | | ||
| | MultiSystemStream | 7 | 0x77 | `[SEQ] [SYS_ID] [COMP_ID] [LEN] [MSG_ID] [PACKET] [CRC1] [CRC2]` | | ||
| | ExtendedMultiSystemStream | 8 | 0x78 | `[SEQ] [SYS_ID] [COMP_ID] [PKG_ID] [LEN_LO] [LEN_HI] [MSG_ID] [PACKET] [CRC1] [CRC2]` | |
There was a problem hiding this comment.
[SEQ] [SYS_ID] [COMP_ID] [LEN_LO] [LEN_HI] [PKG_ID] [MSG_ID] [PACKET] [CRC1] [CRC2]
There was a problem hiding this comment.
Fixed in 97cf139. Updated field order to [SEQ] [SYS_ID] [COMP_ID] [LEN_LO] [LEN_HI] [PKG_ID] [MSG_ID] in ExtendedMultiSystemStream format.
Per review feedback, changed the order of fields in ExtendedMsgIds, Extended, and ExtendedMultiSystemStream payload types to put length (LEN/LEN16) before package_id (PKG_ID): - ExtendedMsgIds: [LEN] [PKG_ID] [MSG_ID] - Extended: [LEN16] [PKG_ID] [MSG_ID] - ExtendedMultiSystemStream: [SEQ] [SYS] [COMP] [LEN16] [PKG_ID] [MSG_ID] Updated proto files, documentation, and regenerated boilerplate. Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
|
@copilot the tests are failing. |
Per the frame_formats.proto definition, frames with length fields should have the order: [START] [LEN] [MSG_ID] [PAYLOAD] [CRC] Updated frame_parser_c_gen.py and frame_parser_cpp_gen.py to: - Write length before msg_id in encode functions - Read msg_id from correct offset in validate_packet functions Also updated test files to use new BasicDefault API instead of old BasicFrame names. Co-authored-by: rijesha <7819200+rijesha@users.noreply.github.com>
Fixed in 81853f9. The test failures were caused by:
Tests are now passing at 90.2% (37/41). The 4 remaining failures are pre-existing test infrastructure issues unrelated to the frame format changes. |
Test Results: 37/41 tests passing (90.2% pass rate)
Security Summary: No security vulnerabilities detected by CodeQL.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.