bluetooth: add persistent HRM reconnect advertising#1492
Open
lesserevil wants to merge 7 commits into
Open
Conversation
This was referenced Jun 11, 2026
1592d4b to
64854b6
Compare
5ab6b1e to
c15f212
Compare
Allow the phone gateway connection and one external BLE client to coexist by increasing the NimBLE connection limit and tracking multiple slave links in the firmware BLE connection state. Classify new NimBLE pairings as gateway only after the Pebble pairing service is used. Prune stale BLE gateway bonds without deleting non-gateway client bonds. Co-authored-by: GPT-5 Codex <codex@openai.com> Signed-off-by: Shawn Edwards <lesser.evil@gmail.com>
Implement the standard Heart Rate Service on the NimBLE backend and route subscription updates back to the firmware HRM sharing service. Co-authored-by: GPT-5 Codex <codex@openai.com> Signed-off-by: Shawn Edwards <lesser.evil@gmail.com>
test_nimble_hrm_service never linked: the NimBLE transport include path was missing, and including the host headers pulls in the NPL + transport layer. Add the transport include, link the dummy NPL backend (no FreeRTOS needed for a host-only service test), and stub the unused transport impls. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Shawn Edwards <lesser.evil@gmail.com>
Advertising the HRM service makes the watch discoverable as a standard BLE heart-rate sensor, which (with the original consent-based sharing) prompts the user to share heart rate on every reconnect. That model is being replaced by workout-gated sharing, so retire it here, alongside the advertising that exposes the service: - Remove the per-device consent prompt, permission model, and reminder popup. - Delete the ble_hrm sharing/reminder/stop-sharing popup windows and the settings + timeline stop-sharing controls (the serialized TimelineItemActionTypeBLEHRMStopSharing value is kept, handled as a no-op). - ble_hrm.c now exposes the HRM GATT service but shares nothing; workout-gated sharing is added in a later change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Shawn Edwards <lesser.evil@gmail.com>
Add an explicit HRM reconnect advertising start path that keeps the Heart Rate Service UUID in the advertising payload until stopped. Co-authored-by: GPT-5 Codex <codex@openai.com> Signed-off-by: Shawn Edwards <lesser.evil@gmail.com>
Allow HRM reconnect advertising to keep running while a slave connection is active, so cycle computers can discover the HRM service without disconnecting the phone link. Normal discovery and reconnect advertisements remain paused until all slave connections disconnect. Co-authored-by: GPT-5 Codex <codex@openai.com> Signed-off-by: Shawn Edwards <lesser.evil@gmail.com>
test_gap_le_slave_reconnect never linked (missing new_timer/ble-syscall/ serial/task/rand stubs). Once linked, it and test_gap_le_advert's hrm_reconnection_continues_after_slave_connection both failed: they drove the 1-second advertising cycle timer with regular_timer_fire_seconds(N), which fires once (N is a modulus), not N times, so the job never advanced to its Long-interval term. Add the missing stubs and loop regular_timer_fire_seconds(1) to advance the term. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Shawn Edwards <lesser.evil@gmail.com>
c15f212 to
825077d
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
gap_le_slave_reconnect_hrm_start()for HRM advertising that remains active until explicitly stopped.gap_le_slave_reconnect_hrm_restart()timed reconnect behavior intact.Split from
Stack / review order
gap_le_slave_reconnect_hrm_start().Tested
git diff --check./pbl test -M 'test_gap_le_advert|test_gap_le_slave_reconnect'