Browse Source
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
pull/1991/head
Wessel Nieboer
3 months ago
No known key found for this signature in database
GPG Key ID: 929C8E45E33B5FD2
1 changed files with
3 additions and
1 deletions
-
src/helpers/nrf52/SerialBLEInterface.cpp
|
|
@ -246,6 +246,7 @@ void SerialBLEInterface::enable() { |
|
|
clearBuffers(); |
|
|
clearBuffers(); |
|
|
_last_health_check = millis(); |
|
|
_last_health_check = millis(); |
|
|
|
|
|
|
|
|
|
|
|
Bluefruit.Advertising.restartOnDisconnect(true); |
|
|
Bluefruit.Advertising.start(0); |
|
|
Bluefruit.Advertising.start(0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -259,8 +260,9 @@ void SerialBLEInterface::disable() { |
|
|
_isEnabled = false; |
|
|
_isEnabled = false; |
|
|
BLE_DEBUG_PRINTLN("SerialBLEInterface: disable"); |
|
|
BLE_DEBUG_PRINTLN("SerialBLEInterface: disable"); |
|
|
|
|
|
|
|
|
disconnect(); |
|
|
Bluefruit.Advertising.restartOnDisconnect(false); |
|
|
Bluefruit.Advertising.stop(); |
|
|
Bluefruit.Advertising.stop(); |
|
|
|
|
|
disconnect(); |
|
|
_last_health_check = 0; |
|
|
_last_health_check = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|