fix: preserve bonded BLE reconnects
This commit is contained in:
1 parent
0f98c46556
commit
ef45704c53
1 file changed
+1
-4
@@ -103,10 +103,9 @@ void SerialBLEInterface::onMtuChanged(BLEServer* pServer, esp_ble_gatts_cb_param
|
|||||||
|
|
||||||
void SerialBLEInterface::onDisconnect(BLEServer* pServer) {
|
void SerialBLEInterface::onDisconnect(BLEServer* pServer) {
|
||||||
BLE_DEBUG_PRINTLN("onDisconnect()");
|
BLE_DEBUG_PRINTLN("onDisconnect()");
|
||||||
|
deviceConnected = false;
|
||||||
if (_isEnabled) {
|
if (_isEnabled) {
|
||||||
adv_restart_time = millis() + ADVERT_RESTART_DELAY;
|
adv_restart_time = millis() + ADVERT_RESTART_DELAY;
|
||||||
|
|
||||||
// loop() will detect this on next loop, and set deviceConnected to false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,8 +214,6 @@ size_t SerialBLEInterface::checkRecvFrame(uint8_t dest[]) {
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pServer->getConnectedCount() == 0) deviceConnected = false;
|
|
||||||
|
|
||||||
if (deviceConnected != oldDeviceConnected) {
|
if (deviceConnected != oldDeviceConnected) {
|
||||||
if (!deviceConnected) { // disconnecting
|
if (!deviceConnected) { // disconnecting
|
||||||
clearBuffers();
|
clearBuffers();
|
||||||
|
|||||||
Reference in new issue
Block a user