plan 0017: SensorEgg pairing menu + live-data test page - #162
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AcdBRTn52QpCQWkyVm5Lkg
parseMac/formatMac (settings-string codec), macReverse (human <-> ble_gap_addr_t LSB-first, aliasing-safe), macIsWildcard, macAccepts — the byte-order reversal the scan callback depends on finally moves under host test, with a case pinning that a same-order compare rejects. kPairingTimeoutMs (120 s, camera parity) and kMacStrLen live with the other tunables. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AcdBRTn52QpCQWkyVm5Lkg
Runtime MAC filter boots from the SENSOREGG_MAC fallback and loads sensoregg_mac at SENSOREGG_SETUP(); the scan callback stays protocol- blind (it additionally memcpys the advertiser address into a per-slot field of the existing double buffer, ready-flag-last preserved) and bypasses the MAC filter while the capture window is open. Capture runs in the main-loop drain on the parsed pairingActive bit: persist first, then the RAM filter, then close the window — a failed SD write retries on the next frame. 120 s window timeout; bench latch (eggTestActive) and the pairing window now force the race-gated scanner on; packet-rate meter for the test page. Twelve new public accessors with no-op twins. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AcdBRTn52QpCQWkyVm5Lkg
Main-menu row 'Egg' (index 6, appended after Camera so nothing shifts), PAGE_PAIR_EGG (-20) cloning the camera page's shape — paired = Back/Test/Unpair with Back at index 0, unpaired = window-gated capture status with B2 cancel and B1 reserved for future manual entry — and PAGE_EGG_TEST (-21): rf tri-state + proto version, EGT/CJ/AUX/BAT, sequence + measured packet rate, live PAIR/FAULT flags, active MAC filter, Back. All five display_ui coupling points wired under the build flag; the camera test page now latches the egg bench scan on enter/exit, restoring the desk-soak behavior its comment promised (stale since plan 0012's race gate — comment fixed). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AcdBRTn52QpCQWkyVm5Lkg
Flag-0 sim never renders the Egg pages; stubs mirror the module's full surface so a future flag-1 sim build links. Golden hashes verified UNCHANGED — the gate does not leak into stock renders. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AcdBRTn52QpCQWkyVm5Lkg
…ables Also fixes the two stale subsystem-14 blocks that still described a PW-ADV-1-only 14-byte parser and hardcoded-MAC-only pairing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AcdBRTn52QpCQWkyVm5Lkg
Coverage — host-testable units📂 Overall coverage
📄 File coverage
|
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
Adds the on-device pairing story the egg subsystem was missing (design record:
docs/plans/0017-sensoregg-pairing-menu.md):kPairingTimeoutMs) forces the race-gated scanner on and bypasses the MAC filter; the first egg heard advertising its own pairing-window flag (egg-side long-press, payload flags bit0 — parsed since the v2 round but never consumed) is stored to the newsensoregg_macsetting. Persist-first (a failed SD write keeps the window open to retry), applied live;SENSOREGG_MACdemoted to fallback. Unpair = persist-first""→ accept-any (today's behavior).sensoreggSequence().NAoff-track since plan 0012 race-gated the scanner; entering the page now latches the egg bench mode too (stale comment fixed).parseMac/formatMac/macReverse/macIsWildcard/macAccepts) live in the host-testedsensoregg_protocolunit — the LSB-first byte reversal the scan callback depends on is finally under test, including a case pinning that a same-order compare rejects.Everything sits behind
BIRDSEYE_ENABLE_SENSOREGG; the flag-0 build and the sim are byte-identical to before.Type of change
How it was verified
ctest --test-dir tests/build) — including the new MAC-helper matrix (parse accept/reject, round-trip, reversal involution, wildcard semantics, LSB-first pin)clang-tidyclean — left to CI#ifmistakes hide): ON 46% flash / 35% RAM, OFF 45% / 35%, no new warningsChecklist
CHANGELOG.mdupdated under[Unreleased](if user-visible)ARCHITECTURE.md/CLAUDE.mdupdated (if a module or interface changed) — CLAUDE.md page-id section, subsystem 14, settings + tuning tablestests/Related issues
Companion to the DovesSensorEgg repo's PerchWerks migration (its
pw_adv_encode.hstill claims the logger drops v2 frames — a one-line cleanup lands there separately).🤖 Generated with Claude Code
https://claude.ai/code/session_01AcdBRTn52QpCQWkyVm5Lkg
Generated by Claude Code