bugfix mqttclient.cpp

This commit is contained in:
Klaus K Wilting 2020-10-31 12:50:48 +01:00
parent 8e188f3178
commit 229daf080c

View File

@ -124,7 +124,7 @@ void mqtt_client_task(void *param) {
if (mqttClient.connected()) {
char buffer[PAYLOAD_BUFFER_SIZE + 3];
snprintf(buffer, msg.MessageSize + 3, "%s/%u", msg.MessagePort,
snprintf(buffer, msg.MessageSize + 3, "%u/%s", msg.MessagePort,
msg.Message);
if (mqttClient.publish(MQTT_OUTTOPIC, buffer)) {
@ -174,7 +174,7 @@ void mqtt_enqueuedata(MessageBuffer_t *message) {
void mqtt_callback(MQTTClient *client, char topic[], char payload[],
int length) {
if (topic == MQTT_INTOPIC)
if (strcmp(topic, MQTT_INTOPIC) == 0)
rcommand((const uint8_t *)payload, (const uint8_t)length);
}