changed topic structure
This commit is contained in:
parent
5f6c4d62b3
commit
f2b64b5c09
|
|
@ -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);
|
ESP_LOGI(TAG, "MQTT_EVENT_CONNECTED client %d", ctx->mqtt_index);
|
||||||
ComposeTopic(topic,
|
ComposeTopic(topic,
|
||||||
GetSysConf()->mqttStation[ctx->mqtt_index].RootTopic,
|
GetSysConf()->mqttStation[ctx->mqtt_index].RootTopic,
|
||||||
"DOWNLINK",
|
"DWLINK",
|
||||||
GetSysConf()->mqttStation[ctx->mqtt_index].ClientID,
|
GetSysConf()->mqttStation[ctx->mqtt_index].ClientID,
|
||||||
"SYSTEM");
|
"SYSTEM");
|
||||||
msg_id = esp_mqtt_client_subscribe(client, (const char*) topic, 0);
|
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
|
//Check if topic is SYSTEM and pass data to handler
|
||||||
ComposeTopic(topic,
|
ComposeTopic(topic,
|
||||||
GetSysConf()->mqttStation[ctx->mqtt_index].RootTopic,
|
GetSysConf()->mqttStation[ctx->mqtt_index].RootTopic,
|
||||||
"DOWNLINK",
|
"DWLINK",
|
||||||
GetSysConf()->mqttStation[ctx->mqtt_index].ClientID,
|
GetSysConf()->mqttStation[ctx->mqtt_index].ClientID,
|
||||||
"SYSTEM");
|
"SYSTEM");
|
||||||
if (!memcmp(topic, event->topic, event->topic_len))
|
if (!memcmp(topic, event->topic, event->topic_len))
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
* "messid":12345, //uint32_t message id for request/response context
|
* "messid":12345, //uint32_t message id for request/response context
|
||||||
* "api":"2.0", //string of current API version
|
* "api":"2.0", //string of current API version
|
||||||
* "request":"GET", //string request type - "GET" or "POST" allowed
|
* "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)
|
* "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)
|
* "reload":"true" //string "true" or "false" is needed reload page after POST request (required if request is POST)
|
||||||
* }
|
* }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user