Skip to content

bluetooth: add NimBLE HRM service#1491

Open
lesserevil wants to merge 4 commits into
coredevices:mainfrom
lesserevil:nimble-hrm-service
Open

bluetooth: add NimBLE HRM service#1491
lesserevil wants to merge 4 commits into
coredevices:mainfrom
lesserevil:nimble-hrm-service

Conversation

@lesserevil

@lesserevil lesserevil commented Jun 11, 2026

Copy link
Copy Markdown

Summary

  • Implement the standard BLE Heart Rate Service on the NimBLE backend.
  • Register the HRM GATT service during NimBLE startup.
  • Route NimBLE characteristic subscription changes back to the firmware BLE HRM sharing service.
  • Add backend no-op implementations for QEMU/stub builds.

Split from

Stack / review order

Tested

  • ./pbl test -M test_nimble_hrm_service --show_output
  • Also validated in the rebuilt workout-sharing stack with ./pbl build and gitlint --commits upstream/main..HEAD.

lesserevil and others added 4 commits June 14, 2026 21:34
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>
@lesserevil lesserevil force-pushed the nimble-hrm-service branch from 1ec0215 to 3fdd817 Compare June 14, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant