From 6a4b38a0cbc8622977596c3674cd49426e9b49a7 Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 7 Dec 2023 16:59:06 -0600 Subject: [PATCH] [BT] Fix scan continue even disconnected from network (#1829) and cause an undesired restart --- main/ZgatewayBT.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/ZgatewayBT.ino b/main/ZgatewayBT.ino index 210aa05..1ac2a1e 100644 --- a/main/ZgatewayBT.ino +++ b/main/ZgatewayBT.ino @@ -786,8 +786,8 @@ void coreTask(void* pvParameters) { n++; delay(1000); } - if (client.state() != 0) { - Log.warning(F("MQTT client disconnected no BLE scan" CR)); + if (!connected) { + Log.warning(F("MQTT client or Network disconnected no BLE scan" CR)); } else if (!BTProcessLock) { if (xSemaphoreTake(semaphoreBLEOperation, pdMS_TO_TICKS(30000)) == pdTRUE) { BLEscan();