Skip to content

Commit

Permalink
Add exit if already processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-vdm committed Oct 26, 2023
1 parent ad23787 commit ae08ec8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions firmware/main/EventParticipationTrendsFirmware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ static void flashLed(){
}

static void SendBufferAsSingleJsonArray(void*){
static bool running = false;
if(running){
esp_restart();
}
running = true;
// This will process the files in the buffer and send them as a json object containing an array of devices, along with the mac-address of this esp32
data = "";
data += "{\"sensorMac\": \"";
Expand All @@ -78,6 +83,7 @@ static void SendBufferAsSingleJsonArray(void*){
mqtt_publish_sensor(data.c_str());
flashLed();
esp_wifi_set_promiscuous(true);
running = false;
vTaskDelete(NULL);
}

Expand Down

0 comments on commit ae08ec8

Please sign in to comment.