From e3afbf975ebc69b9b9a2a82975b4e567c7be6f34 Mon Sep 17 00:00:00 2001 From: Wessel Nieboer Date: Tue, 10 Mar 2026 14:31:58 +0100 Subject: [PATCH] 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 --- src/helpers/nrf52/SerialBLEInterface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/helpers/nrf52/SerialBLEInterface.cpp b/src/helpers/nrf52/SerialBLEInterface.cpp index 5648707e..5a3017af 100644 --- a/src/helpers/nrf52/SerialBLEInterface.cpp +++ b/src/helpers/nrf52/SerialBLEInterface.cpp @@ -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; }