Skip to content

Commit 6c9529a

Browse files
committed
do not launch a ble scan if mqtt client is disconnected
1 parent a05fd01 commit 6c9529a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main/ZgatewayBT.ino

+6-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,12 @@ void MiBandDiscovery(char * mac){
530530
while(true){
531531
trc(taskMessage);
532532
delay(BLEinterval);
533-
BLEscan();
533+
if (client.state() == 0) {
534+
BLEscan();
535+
}else{
536+
trc("MQTT client disconnected no BLE scan");
537+
delay(1000);
538+
}
534539
}
535540
}
536541

0 commit comments

Comments
 (0)