mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-11 23:52:14 +00:00
Ignore JSON enabled setting on nRF52 platforms (#3286)
Not supported, see #2804 Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
parent
824991c178
commit
0f27992c5a
@ -351,11 +351,13 @@ void MQTT::sendSubscriptions()
|
|||||||
std::string topic = cryptTopic + channels.getGlobalId(i) + "/#";
|
std::string topic = cryptTopic + channels.getGlobalId(i) + "/#";
|
||||||
LOG_INFO("Subscribing to %s\n", topic.c_str());
|
LOG_INFO("Subscribing to %s\n", topic.c_str());
|
||||||
pubSub.subscribe(topic.c_str(), 1); // FIXME, is QOS 1 right?
|
pubSub.subscribe(topic.c_str(), 1); // FIXME, is QOS 1 right?
|
||||||
|
#ifndef ARCH_NRF52 // JSON is not supported on nRF52, see issue #2804
|
||||||
if (moduleConfig.mqtt.json_enabled == true) {
|
if (moduleConfig.mqtt.json_enabled == true) {
|
||||||
std::string topicDecoded = jsonTopic + channels.getGlobalId(i) + "/#";
|
std::string topicDecoded = jsonTopic + channels.getGlobalId(i) + "/#";
|
||||||
LOG_INFO("Subscribing to %s\n", topicDecoded.c_str());
|
LOG_INFO("Subscribing to %s\n", topicDecoded.c_str());
|
||||||
pubSub.subscribe(topicDecoded.c_str(), 1); // FIXME, is QOS 1 right?
|
pubSub.subscribe(topicDecoded.c_str(), 1); // FIXME, is QOS 1 right?
|
||||||
}
|
}
|
||||||
|
#endif // ARCH_NRF52
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -450,6 +452,7 @@ void MQTT::publishQueuedMessages()
|
|||||||
|
|
||||||
publish(topic.c_str(), bytes, numBytes, false);
|
publish(topic.c_str(), bytes, numBytes, false);
|
||||||
|
|
||||||
|
#ifndef ARCH_NRF52 // JSON is not supported on nRF52, see issue #2804
|
||||||
if (moduleConfig.mqtt.json_enabled) {
|
if (moduleConfig.mqtt.json_enabled) {
|
||||||
// handle json topic
|
// handle json topic
|
||||||
auto jsonString = this->meshPacketToJson(env->packet);
|
auto jsonString = this->meshPacketToJson(env->packet);
|
||||||
@ -460,6 +463,7 @@ void MQTT::publishQueuedMessages()
|
|||||||
publish(topicJson.c_str(), jsonString.c_str(), false);
|
publish(topicJson.c_str(), jsonString.c_str(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // ARCH_NRF52
|
||||||
mqttPool.release(env);
|
mqttPool.release(env);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -504,6 +508,7 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp, const meshtastic_MeshPacket &
|
|||||||
|
|
||||||
publish(topic.c_str(), bytes, numBytes, false);
|
publish(topic.c_str(), bytes, numBytes, false);
|
||||||
|
|
||||||
|
#ifndef ARCH_NRF52 // JSON is not supported on nRF52, see issue #2804
|
||||||
if (moduleConfig.mqtt.json_enabled) {
|
if (moduleConfig.mqtt.json_enabled) {
|
||||||
// handle json topic
|
// handle json topic
|
||||||
auto jsonString = this->meshPacketToJson((meshtastic_MeshPacket *)&mp_decoded);
|
auto jsonString = this->meshPacketToJson((meshtastic_MeshPacket *)&mp_decoded);
|
||||||
@ -514,7 +519,7 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp, const meshtastic_MeshPacket &
|
|||||||
publish(topicJson.c_str(), jsonString.c_str(), false);
|
publish(topicJson.c_str(), jsonString.c_str(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // ARCH_NRF52
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("MQTT not connected, queueing packet\n");
|
LOG_INFO("MQTT not connected, queueing packet\n");
|
||||||
if (mqttQueue.numFree() == 0) {
|
if (mqttQueue.numFree() == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user