Skip to content

bluetooth: support concurrent BLE clients#1513

Open
lesserevil wants to merge 1 commit into
coredevices:mainfrom
lesserevil:ble-concurrent-slave-connections
Open

bluetooth: support concurrent BLE clients#1513
lesserevil wants to merge 1 commit into
coredevices:mainfrom
lesserevil:ble-concurrent-slave-connections

Conversation

@lesserevil

@lesserevil lesserevil commented Jun 12, 2026

Copy link
Copy Markdown

Summary

  • Allow the gateway phone link and one external BLE client to coexist.
  • Track multiple local-slave BLE connections instead of a single boolean.
  • Classify NimBLE pairings as gateway only after Pebble pairing service use.
  • Prune stale gateway bonds without deleting non-gateway BLE client bonds.

Scope

This is the BLE infrastructure branch needed by workout HRM sharing. It intentionally does not add the HRM GATT service, HRM advertising primitive, or workout publishing logic.

Tests

  • git diff --check
  • ./pbl test -M 'test_bluetooth_persistent_storage|test_nimble_hrm_service'
  • ./pbl build
  • gitlint --commits HEAD~1..HEAD

Note: test_gap_le_connect remains in the repository BROKEN_TESTS list, so the new concurrent-slave-connection unit test is not run by the default test target until that suite is re-enabled.

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>
@lesserevil lesserevil force-pushed the ble-concurrent-slave-connections branch from f001c00 to f2ae093 Compare June 14, 2026 21:46
@lesserevil

Copy link
Copy Markdown
Author

Sorry for the spam. This PR and the other three in the set have been running on my watch just fine, and the new feature works.

Please let me know if you need more info/testing/etc.

@ericmigi

Copy link
Copy Markdown
Collaborator

Pretty cool. Can you share how you tested this and which other BLE devices you tested with?

@lesserevil

Copy link
Copy Markdown
Author

I have tested it on my PT2, and connected to a Garmin 1040 computer and used a BLE sniffer on my phone to check that the packets start/stop when the workout starts/stops on the watch.

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.

2 participants