Repository navigation
Decode the binary wire protocol in the logger - #2
Merged
Merged
Conversation
- pipeline/wire.py: COBS/CRC-16 frame decoder and a StreamDecoder that detects binary vs CSV firmware and yields the same events for both - logger writes the same raw.csv either way, records the firmware's identity in raw/firmware.json, and reports lost frames and CRC errors - refuse firmware with an unknown protocol version - tests against a golden stream generated by the firmware's encoder
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.
Host side of step 2. Pairs with firmware PR #2 (binary wire protocol v1).
What changes
pipeline/wire.py: frame decoder (COBS, CRC-16/CCITT-FALSE) and aStreamDecoderthat works out whether the board runs the binary firmware or the CSV debug build and produces the same events for both.logger.pyreads raw bytes through the decoder.raw.csvhas the same 22 columns as before, so trim, diagnose, calibrate and plot are untouched.raw/firmware.jsonstores what the firmware reported (board, version, git revision, sensors);metadata.jsonincludes it.Testing
tests/fixtures/wire_golden_v1.bin, which is the output of the firmware's own encoder (firmware/tools/host/wire_dump.cpp), so encoder and decoder are checked against each other.Old CSV firmware keeps working with this logger, so this PR is safe to merge before the firmware one.
Generated by Claude Code