BLE advertising improvements#723
Conversation
Add `CHIP_BLE_MULTI_IDENTITY_SUPPORT` Kconfig option. Filter Matter BLE manager and advertising arbiter callbacks to only handle connections on the Matter BLE identity. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
Replace the sWasDisconnection flag with an atomic restart flag so advertising can be retried when bt_le_adv_start() fails due to lack of available connection object. With CONFIG_CHIP_BLE_MULTI_IDENTITY_SUPPORT, disconnect and recycled callbacks can arrive in an order where a restart attempt runs before all connection slots are available. Re-arm the flag on failure so a subsequent recycled callback schedules another restart attempt. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
There was a problem hiding this comment.
Pull request overview
This PR improves Zephyr BLE advertising behavior when multiple Bluetooth identities exist, adding a Kconfig gate for multi-identity handling, filtering Matter BLE traffic to the Matter identity, and making advertising restart more robust when connection objects are temporarily unavailable.
Changes:
- Add
CHIP_BLE_MULTI_IDENTITY_SUPPORTKconfig option to enable multi-identity filtering behavior. - Filter Matter BLE GATT/connection callbacks to only handle the Matter identity (
kMatterBleIdentity). - Replace the previous restart boolean with an atomic restart flag and retry logic tied to connection object recycling.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/platform/Zephyr/BLEManagerImpl.cpp | Filters Matter BLE handlers to only accept connections on the Matter BLE identity. |
| src/platform/Zephyr/BLEAdvertisingArbiter.cpp | Uses an atomic restart flag and retries connectable advertising after recycled callbacks. |
| config/nrfconnect/chip-module/Kconfig | Introduces CHIP_BLE_MULTI_IDENTITY_SUPPORT configuration option. |
|
|
||
| #ifdef CONFIG_CHIP_BLE_MULTI_IDENTITY_SUPPORT | ||
|
|
||
| bool IsMatterIdentity(const bt_conn * conn) |
There was a problem hiding this comment.
Consider defining it always, but simply return true for !CONFIG_CHIP_BLE_MULTI_IDENTITY_SUPPORT. This will reduce the number of ifdefs in the code.
There was a problem hiding this comment.
I think that could be confusing, maybe it would be better to define something like ShouldProcessConnection and use IsMatterIdentity inside. Let's keep it as is for now.
Automatically created by action-manifest-pr GH action from PR: nrfconnect/sdk-connectedhomeip#723 Signed-off-by: Nordic Builder <pylon@nordicsemi.no>
Automatically created by action-manifest-pr GH action from PR: nrfconnect/sdk-connectedhomeip#723 Signed-off-by: Nordic Builder <pylon@nordicsemi.no>
Summary
This PR adds multi BT indentity support and fixes advertising restart when multiple identities share the connection pool.
Testing
Tested with a second BT identity used by Aliro.