Skip to content

Refactor BLE pairing, whitelist, and advertising#107

Merged
zjwhitehead merged 1 commit intomasterfrom
ble-improvements
Mar 27, 2026
Merged

Refactor BLE pairing, whitelist, and advertising#107
zjwhitehead merged 1 commit intomasterfrom
ble-improvements

Conversation

@zjwhitehead
Copy link
Copy Markdown
Member

Add pairingModeTransitionActive to suppress advertising restarts during bond-clear transitions and prevent advertising while the whitelist is being modified. Replace clearWhiteList with syncWhiteListFromBonds that prunes stale whitelist entries and only adds missing bonded addresses, and ensure advertising is stopped before changing whitelist to avoid BLE_HS_EBUSY. Make startAdvertising respect the transition flag and avoid immediate restarts from onDisconnect during transitions. Implement enterBLEPairingMode to safely disconnect, stop advertising, and clear bonds (with retries), and add BLE_PAIRING_HOLD_MS plus related button-handler changes to enter pairing mode on a long hold (removing the previous multi-tier unbond/delete flow). These changes improve robustness of whitelist and pairing operations.

Add pairingModeTransitionActive to suppress advertising restarts during bond-clear transitions and prevent advertising while the whitelist is being modified. Replace clearWhiteList with syncWhiteListFromBonds that prunes stale whitelist entries and only adds missing bonded addresses, and ensure advertising is stopped before changing whitelist to avoid BLE_HS_EBUSY. Make startAdvertising respect the transition flag and avoid immediate restarts from onDisconnect during transitions. Implement enterBLEPairingMode to safely disconnect, stop advertising, and clear bonds (with retries), and add BLE_PAIRING_HOLD_MS plus related button-handler changes to enter pairing mode on a long hold (removing the previous multi-tier unbond/delete flow). These changes improve robustness of whitelist and pairing operations.
@zjwhitehead zjwhitehead merged commit 71daefa into master Mar 27, 2026
8 checks passed
@zjwhitehead zjwhitehead deleted the ble-improvements branch March 27, 2026 01:59
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