Fix race condition, connect->disconnect->discovery

This commit is contained in:
James A. Jerkins 2021-09-01 22:48:01 -05:00
parent 00a3f84ea7
commit d69a8e84fa

View File

@ -250,7 +250,9 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
} }
void NimbleController::StartDiscovery() { void NimbleController::StartDiscovery() {
serviceDiscovery.StartDiscovery(connectionHandle); if (connectionHandle != BLE_HS_CONN_HANDLE_NONE) {
serviceDiscovery.StartDiscovery(connectionHandle);
}
} }
uint16_t NimbleController::connHandle() { uint16_t NimbleController::connHandle() {