From f2b64b5c09d5bfe143367505b445bb335e2c1b34 Mon Sep 17 00:00:00 2001 From: Bogdan Pilyugin Date: Mon, 12 Sep 2022 16:49:57 +0200 Subject: [PATCH] changed topic structure --- src/MQTT.c | 4 ++-- src/MQTTSysHandler.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MQTT.c b/src/MQTT.c index 07e34e7..07298b9 100644 --- a/src/MQTT.c +++ b/src/MQTT.c @@ -115,7 +115,7 @@ static void mqtt_system_event_handler(void *handler_args, esp_event_base_t base, ESP_LOGI(TAG, "MQTT_EVENT_CONNECTED client %d", ctx->mqtt_index); ComposeTopic(topic, GetSysConf()->mqttStation[ctx->mqtt_index].RootTopic, - "DOWNLINK", + "DWLINK", GetSysConf()->mqttStation[ctx->mqtt_index].ClientID, "SYSTEM"); msg_id = esp_mqtt_client_subscribe(client, (const char*) topic, 0); @@ -144,7 +144,7 @@ static void mqtt_system_event_handler(void *handler_args, esp_event_base_t base, //Check if topic is SYSTEM and pass data to handler ComposeTopic(topic, GetSysConf()->mqttStation[ctx->mqtt_index].RootTopic, - "DOWNLINK", + "DWLINK", GetSysConf()->mqttStation[ctx->mqtt_index].ClientID, "SYSTEM"); if (!memcmp(topic, event->topic, event->topic_len)) diff --git a/src/MQTTSysHandler.c b/src/MQTTSysHandler.c index c8617c4..ba2120d 100644 --- a/src/MQTTSysHandler.c +++ b/src/MQTTSysHandler.c @@ -27,7 +27,7 @@ * "messid":12345, //uint32_t message id for request/response context * "api":"2.0", //string of current API version * "request":"GET", //string request type - "GET" or "POST" allowed - * "url":"iotronic.cloud", //string url of resource + * "url":"status.json", //string url of resource (generally a file name) * "postdata":"param1=value¶m2=value", //string of POST data payload (required if request is POST) * "reload":"true" //string "true" or "false" is needed reload page after POST request (required if request is POST) * }