[BT] Fix crash when sending multiple BT commands at the same time (#2059)
Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
1 parent
eab1354d7a
commit
776ed6568d
1 file changed
+8
-2
+8
-2
@@ -1551,8 +1551,14 @@ void MQTTtoBT(char* topicOri, JsonObject& BTdata) { // json object decoding
|
|||||||
BTConfig_fromJson(BTdata);
|
BTConfig_fromJson(BTdata);
|
||||||
|
|
||||||
} else if (cmpToMainTopic(topicOri, subjectMQTTtoBT)) {
|
} else if (cmpToMainTopic(topicOri, subjectMQTTtoBT)) {
|
||||||
KnownBTActions(BTdata);
|
if (xSemaphoreTake(semaphoreBLEOperation, pdMS_TO_TICKS(5000)) == pdTRUE) {
|
||||||
MQTTtoBTAction(BTdata);
|
KnownBTActions(BTdata);
|
||||||
|
MQTTtoBTAction(BTdata);
|
||||||
|
xSemaphoreGive(semaphoreBLEOperation);
|
||||||
|
} else {
|
||||||
|
Log.error(F("BLE busy - command not sent" CR));
|
||||||
|
gatewayState = GatewayState::ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user