The recording heartbeat survives disconnect — the board re-arms it - #23
Merged
Conversation
Follow-up to the group-logging cycle: the LED pattern and play were byte-perfect on the wire, but the firmware stops LED playback the moment the link drops, so unattended boards never blinked. The board now re-arms its own heartbeat: group start records two DISCONNECT EVENTS (Settings 0x0A, revision ≥ 2) — re-set the red pattern, then play — so every link drop relights the blink with no phone involved. The immediate setLED still covers the connected window, giving continuous indication across the handoff. The event ids are stamped onto the board's LogSessionRecords (ledEventIDsJSON, lightweight local-only migration) because the bindings OUTLIVE app sessions: an un-removed pair would relight the LED on every future disconnect forever. The collect pass tears them down right after stopping the LED, resolving ids from the records so cleanup survives app restarts. All best-effort — the heartbeat is a courtesy and can never fail a logging session. MWEvent gains a public init(id:) so persisted handles can be reconstructed for removal — bindings live on the board, not in the process. Co-Authored-By: Claude Fable 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.
The parked follow-up from the group-logging cycle. Field evidence showed the LED pattern + play bytes were correct but the firmware kills LED playback when the link drops — so unattended boards never blinked.
Fix: the board re-arms its own heartbeat. Group start records two disconnect events (Settings
0x0A, revision ≥ 2): re-set the red pattern, then play. Every link drop relights the blink with no phone involved; the immediatesetLEDcovers the connected window so indication is continuous across the handoff.Cleanup is the load-bearing part: disconnect-event bindings live on the board and outlive app sessions — an un-removed pair would relight the LED on every future disconnect, forever. The event ids are stamped onto the board's pending records (
ledEventIDsJSON, lightweight local-only migration), and the collect pass removes them right after stopping the LED — resolving ids from the records, so cleanup survives app restarts. Everything is best-effort: the heartbeat is a courtesy and can never fail a logging session.SDK:
MWEventgains a publicinit(id:)for reconstructing persisted handles.Hardware check: start a group → pocket the boards → they should blink red every 5 s while disconnected; Stop & Download All → blinking stops and stays stopped across subsequent connects/disconnects. Full app suite + 1058 SPM tests green.
🤖 Generated with Claude Code