Browse Source
Merge pull request #1991 from weebl2000/prevent-auto-restart-ble-nrf52
Prevent auto-restarting BLE when disabling it on nRF52
pull/1999/head
Liam Cottle
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
1 deletions
-
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; |
|
|
|
} |
|
|
|
|
|
|
|
|