From 90bc0a32dad1e11faafedbfcff33bd7acc3d2baf Mon Sep 17 00:00:00 2001 From: Benjamin Runnels Date: Sun, 20 Sep 2015 10:20:35 -0500 Subject: [PATCH] Changed mqtt statusTopicStr to not pre-pend client_id --- esp-link/mqtt_client.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/esp-link/mqtt_client.c b/esp-link/mqtt_client.c index 8ada7a9..654d0ec 100644 --- a/esp-link/mqtt_client.c +++ b/esp-link/mqtt_client.c @@ -87,10 +87,13 @@ mqtt_client_init() flashConfig.mqtt_keepalive); if (flashConfig.mqtt_status_enable) { - statusTopicStr = (char*)os_zalloc(strlen(flashConfig.mqtt_clientid) + strlen(flashConfig.mqtt_status_topic) + 2); - os_strcpy(statusTopicStr, flashConfig.mqtt_clientid); - os_strcat(statusTopicStr, "/"); - os_strcat(statusTopicStr, flashConfig.mqtt_status_topic); +// removed client_id concat for now until a better solution is devised +// statusTopicStr = (char*)os_zalloc(strlen(flashConfig.mqtt_clientid) + strlen(flashConfig.mqtt_status_topic) + 2); +// os_strcpy(statusTopicStr, flashConfig.mqtt_clientid); +// os_strcat(statusTopicStr, "/"); + + statusTopicStr = (char*)os_zalloc(strlen(flashConfig.mqtt_status_topic) + 1); + os_strcpy(statusTopicStr, flashConfig.mqtt_status_topic); } char* onlineMsg = " is online";