From a4817f27f198396e584a609f2fbd35d7c9682656 Mon Sep 17 00:00:00 2001 From: hans-jurgen Date: Mon, 30 Sep 2024 21:12:53 +0200 Subject: [PATCH] 5024-09-3001 --- src/main.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 519f9f2..41288b2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,6 +33,7 @@ Ticker Tic; static BLEAddress *pServerAddress; BLEScan* pBLEScan ; int scanTime = 5; //In seconds +bool Status = false; long int Feldstaerke; @@ -201,14 +202,15 @@ void loop() pBLEScan->start(scanTime); if (gefunden == true){ sprintf(topic, "%s%s%s", "hjk/devices/", ORT, "/telemetry/status" ); - client.publish(topic, "DA", true); - Serial.println(); - Serial.print(topic); Serial.println(" DA"); + client.publish(topic, "DA", true); + Serial.println(); + Serial.print(topic); Serial.println(" DA"); + Status = true; } else { sprintf(topic, "%s%s%s", "hjk/devices/", ORT, "/telemetry/status" ); - client.publish(topic, "FERN", true); - Serial.println(); - Serial.print(topic); Serial.println(" FERN"); + client.publish(topic, "FERN", true); + Serial.println(); + Serial.print(topic); Serial.println(" FERN"); } delay(2000); // Alle 2s nach ibeacon scannen } \ No newline at end of file