Prevent auto-restarting BLE when disabling it on nRF52

If client is still connected, client would automatically reconnect
immediately thus keeping BLE on

fixes #1933
This commit is contained in:
Wessel Nieboer
2026-03-10 14:31:58 +01:00
parent b47b85773d
commit e3afbf975e

View File

@@ -246,6 +246,7 @@ void SerialBLEInterface::enable() {
clearBuffers();
_last_health_check = millis();
Bluefruit.Advertising.restartOnDisconnect(true);
Bluefruit.Advertising.start(0);
}
@@ -259,8 +260,9 @@ void SerialBLEInterface::disable() {
_isEnabled = false;
BLE_DEBUG_PRINTLN("SerialBLEInterface: disable");
disconnect();
Bluefruit.Advertising.restartOnDisconnect(false);
Bluefruit.Advertising.stop();
disconnect();
_last_health_check = 0;
}