Repository navigation
♻️ #171: Compute the frame checksum instead of replaying it - #175
Closed
nofuturekid wants to merge 1 commit into
Closed
nofuturekid wants to merge 1 commit into
nofuturekid wants to merge 1 commit into
Conversation
Framed commands on unit 2, selector 2 carry two CRC-16/USB checksums (reflected polynomial 0xA001, init and final XOR 0xFFFF): one over the 12-byte header and one over the data block, each with its own field zeroed. Until now every command replayed a captured checksum together with its captured sequence number, so no new command could be added without a capture. The new frame builder takes receiver, command id and data and computes both checksums. Each camera hands out its own sequence numbers, seeded from the clock, because the camera drops a frame that repeats the previous sequence number. Sleep, tracking speed, exposure mode type and preset recall now use the builder. Their tests build with the captured sequence numbers and check that the captured frames come out byte for byte, which proves the checksums. Thanks to gnacho for working out the checksum in #171. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Closing this: I moved the Tiny 2 Lite work to a separate tool, obsbot4linux, and won't maintain these changes here. The protocol notes and captures stay public in obsbot-tiny2-lite-protocol in case they help. Thanks for the project! (Written with Claude Code.) |
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.
Refs #171
Implements the checksum part of #171 (thanks @gnacho for working it out):
command02with captured checksum/sequence pairs is replaced byframe.rs, which builds the frame from receiver, command id and data and computes both CRC-16/USB values. Each camera gets its own sequence counter; the camera ignores a frame that repeats the previous sequence number.Sleep, tracking speed, exposure mode type and preset recall now use it with unchanged bytes. Their tests build the frames with the captured sequence numbers and must reproduce the captured frames exactly, which also checks the CRC.
cargo test --all-featurespasses; sleep/wake and speed were checked on a Tiny 2 Lite.Written with Claude Code (AI).
🤖 Generated with Claude Code