mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
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:
parent
b47b85773d
commit
e3afbf975e
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue