Repository navigation
Uploads give the file's CRC16, and skip filehash when the device checked it - #4
Merged
Merged
Conversation
…ked it ufStart now includes "CRC16":"0x...." (CRC16-CCITT, as filehash reports it). Firmware from 2026-10-25 (RaftCore) checks the uploaded file against it once written: a mismatch cancels the upload (failCRC) and the device deletes the file; a match is confirmed in the ufEnd reply (crc16), and then the separate filehash request is skipped - one round trip less per upload, which matters over BLE. Older firmware ignores the CRC, gives no crc16, and the upload is checked with filehash as before. The simulated device does the same (check_crc, on by default; off for older firmware), and the tests cover both. 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.
Summary
ufStartnow includes"CRC16":"0x....", the CRC16-CCITT thatfilehashreports.failCRC) and deletes the file, and RaftCLI reports that the file didn't match what was sent;ufEndreply carriescrc16, and RaftCLI skips its separatefilehashrequest, one round trip less per upload, which helps most over BLE.crc16, so the upload is checked withfilehashas before.The simulated device does the same, with
check_crcon by default and switchable off to behave like older firmware. The tests cover both.Testing
cargo test: 129 pass, and clippy has no new warnings.🤖 Generated with Claude Code