fix: emit NFC config packets last so firmware keeps flash/data_extended (M4)#105
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ed (M4) Python emitted the NFC packet (0x2A) before flash_config (0x2B) and data_extended (0x2C). Firmware has no case 0x2A and its default case skips straight to the CRC, so any config containing NFC entries silently lost flash_config and data_extended on device load. Emit NFC after every packet type the firmware understands. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JRrm95f1qNZzDM9r2SB6KW
00bc90f to
294f47b
Compare
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
M4 — NFC packet 0x2A aborts firmware's config parse (🟠)
Python emitted the NFC packet (
0x2A) beforeflash_config(0x2B) anddata_extended(0x2C). Firmware has nocase 0x2A, and itsdefault:skips straight to the CRC — so any config containing NFC entries silently lostflash_configanddata_extendedon device load.Fix
Emit NFC after every packet type the firmware understands (i.e. last, after
flash_configanddata_extended), so an unknown-to-firmware NFC entry no longer truncates the parse of packets that follow it.Test plan
uv run pytest -q→ 444 passed (new test parses the serialized TLV stream and asserts the0x2Apacket appears after0x2Band0x2C)ruff,mypyclean🤖 Generated with Claude Code