diff --git a/host/esp-t-sim7000g/src/main.cpp b/host/esp-t-sim7000g/src/main.cpp index 67e087cdeb83fb79bb4782a759fbac55967a7390..06a9655e012ebe594581a7dd01f48a43408711a5 100644 --- a/host/esp-t-sim7000g/src/main.cpp +++ b/host/esp-t-sim7000g/src/main.cpp @@ -18,7 +18,7 @@ const char *ntpServer = "pool.ntp.org"; const long gmtOffset_sec = 0; const int daylightOffset_sec = 0; -SemaphoreHandle_t xBinarySemaphore; +SemaphoreHandle_t xMutex; TaskHandle_t Task1; @@ -89,9 +89,9 @@ void on_data_recv(const uint8_t *mac, const uint8_t *incomingData, int len) + measurementType + "=" + value + " " + timestamp; Serial.println(lineData); - xSemaphoreTake(xBinarySemaphore, portMAX_DELAY); + xSemaphoreTake(xMutex, portMAX_DELAY); queue.push(lineData); - xSemaphoreGive(xBinarySemaphore); + xSemaphoreGive(xMutex); } [[noreturn]] void Task1code(void *parameter) @@ -197,7 +197,7 @@ void setup() Serial.println(str); } - xBinarySemaphore = xSemaphoreCreateBinary(); + xMutex = xSemaphoreCreateMutex(); Serial.println("\nWait..."); @@ -364,10 +364,10 @@ void loop() return; } - xSemaphoreTake(xBinarySemaphore, portMAX_DELAY); + xSemaphoreTake(xMutex, portMAX_DELAY); String lineData = queue.front(); queue.pop(); - xSemaphoreGive(xBinarySemaphore); + xSemaphoreGive(xMutex); //"sensorName":"DRS26","timestamp":1666872216,"protocol":"I2C","value":0,"channel":0,"measurementType":"CIRCUMFERENCE_INCREMENT"