summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/ble/NimbleController.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp
index 8b4f3ea8..0f486095 100644
--- a/src/components/ble/NimbleController.cpp
+++ b/src/components/ble/NimbleController.cpp
@@ -250,7 +250,9 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
}
void NimbleController::StartDiscovery() {
- serviceDiscovery.StartDiscovery(connectionHandle);
+ if (connectionHandle != BLE_HS_CONN_HANDLE_NONE) {
+ serviceDiscovery.StartDiscovery(connectionHandle);
+ }
}
uint16_t NimbleController::connHandle() {