[BT] MQTT corruption fix (#2183)
Storing a copy of the ID instead of a pointer to a local variable to avoid MQTT publishing id topic and id property corruption.
This commit is contained in:
1 parent
585df9a420
commit
f0491e188c
4 files changed
+16
-12
No files matched your search
+1
-1
@@ -1400,7 +1400,7 @@ void immediateBTAction(void* pvParameters) {
|
||||
gatewayState = GatewayState::ERROR;
|
||||
StaticJsonDocument<JSON_MSG_BUFFER> BLEdataBuffer;
|
||||
JsonObject BLEdata = BLEdataBuffer.to<JsonObject>();
|
||||
BLEdata["id"] = BLEactions.back().addr.toString().c_str();
|
||||
BLEdata["id"] = BLEactions.back().addr.toString();
|
||||
BLEdata["success"] = false;
|
||||
buildTopicFromId(BLEdata, subjectBTtoMQTT);
|
||||
enqueueJsonObject(BLEdata, QueueSemaphoreTimeOutTask);
|
||||
|
||||
Reference in new issue
Block a user