mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-26 22:33:24 +00:00
Use dedicated map
topic
This commit is contained in:
parent
c7d5698dbc
commit
b45a912409
@ -185,10 +185,12 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), mqttQueue(MAX_MQTT_QUEUE)
|
||||
statusTopic = moduleConfig.mqtt.root + statusTopic;
|
||||
cryptTopic = moduleConfig.mqtt.root + cryptTopic;
|
||||
jsonTopic = moduleConfig.mqtt.root + jsonTopic;
|
||||
mapTopic = moduleConfig.mqtt.root + jsonTopic;
|
||||
} else {
|
||||
statusTopic = "msh" + statusTopic;
|
||||
cryptTopic = "msh" + cryptTopic;
|
||||
jsonTopic = "msh" + jsonTopic;
|
||||
mapTopic = "msh" + mapTopic;
|
||||
}
|
||||
|
||||
if (moduleConfig.mqtt.map_reporting_enabled && moduleConfig.mqtt.has_map_report_settings) {
|
||||
@ -605,8 +607,8 @@ void MQTT::perhapsReportToMap()
|
||||
static uint8_t bytes[meshtastic_MeshPacket_size + 64];
|
||||
size_t numBytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_ServiceEnvelope_msg, se);
|
||||
|
||||
LOG_INFO("MQTT Publish map report to %s\n", statusTopic.c_str());
|
||||
publish(statusTopic.c_str(), bytes, numBytes, false);
|
||||
LOG_INFO("MQTT Publish map report to %s\n", mapTopic.c_str());
|
||||
publish(mapTopic.c_str(), bytes, numBytes, false);
|
||||
|
||||
// Release the allocated memory for ServiceEnvelope and MeshPacket
|
||||
mqttPool.release(se);
|
||||
|
@ -79,9 +79,10 @@ class MQTT : private concurrency::OSThread
|
||||
virtual int32_t runOnce() override;
|
||||
|
||||
private:
|
||||
std::string statusTopic = "/2/stat/"; // For "online"/"offline" message and MapReport
|
||||
std::string statusTopic = "/2/stat/"; // For "online"/"offline" message
|
||||
std::string cryptTopic = "/2/e/"; // msh/2/e/CHANNELID/NODEID
|
||||
std::string jsonTopic = "/2/json/"; // msh/2/json/CHANNELID/NODEID
|
||||
std::string mapTopic = "/2/map/"; // For protobuf-encoded MapReport messages
|
||||
|
||||
// For map reporting (only applies when enabled)
|
||||
uint32_t last_report_to_map = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user