Fix missing msh default topic.

This commit is contained in:
Thomas Göttgens
2023-04-13 22:20:49 +02:00
parent 7bd836673e
commit b43a5bc4f8
3 changed files with 6 additions and 7 deletions

View File

@@ -19,10 +19,6 @@ const int reconnectMax = 5;
MQTT *mqtt;
std::string statusTopic = "/2/stat/";
std::string cryptTopic = "/2/c/"; // msh/2/c/CHANNELID/NODEID
std::string jsonTopic = "/2/json/"; // msh/2/json/CHANNELID/NODEID
static MemoryDynamic<meshtastic_ServiceEnvelope> staticMqttPool;
Allocator<meshtastic_ServiceEnvelope> &mqttPool = staticMqttPool;
@@ -164,7 +160,7 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), pubSub(mqttClient), mqttQueue(MAX_
assert(!mqtt);
mqtt = this;
if (moduleConfig.mqtt.root) {
if (*moduleConfig.mqtt.root) {
statusTopic = moduleConfig.mqtt.root + statusTopic;
cryptTopic = moduleConfig.mqtt.root + cryptTopic;
jsonTopic = moduleConfig.mqtt.root + jsonTopic;