From 758e0882aee006acaac737c862350be425981d5d Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 18 Aug 2022 19:18:38 +0200 Subject: [PATCH] new mqtt topic compose --- include/NetTransport.h | 2 +- include/SystemConfiguration.h | 2 +- src/MQTT.c | 28 ++++++++++++++++++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/include/NetTransport.h b/include/NetTransport.h index 5478da2..b0df497 100644 --- a/include/NetTransport.h +++ b/include/NetTransport.h @@ -1,4 +1,4 @@ - /* Copyright 2022 Bogdan Pilyugin +/* Copyright 2022 Bogdan Pilyugin * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/SystemConfiguration.h b/include/SystemConfiguration.h index e8eadc0..79f5d9b 100644 --- a/include/SystemConfiguration.h +++ b/include/SystemConfiguration.h @@ -27,7 +27,7 @@ #include #include #include "esp_netif.h" -#include +#include "sdkconfig.h" #define DEFAULT_HOST_NAME "DEVICE_HOSTNAME" ///mqtt_index); char sub[64]; + ComposeTopicControl(sub, GetSysConf()->mqttStation[ctx->mqtt_index].RootTopic, GetSysConf()->mqttStation[ctx->mqtt_index].ClientID, 0); msg_id = esp_mqtt_client_subscribe(client, (const char*) sub, 0); ESP_LOGI(TAG, "sent subscribe successful, msg_id=%d", msg_id); + + + ComposeTopicScreen(sub, GetSysConf()->mqttStation[ctx->mqtt_index].RootTopic, GetSysConf()->mqttStation[ctx->mqtt_index].ClientID, 0);