Add MQTT RX status events and fix periodic status publishing
Periodic MQTT status was missing dynamic fields (trunks, cluster_tgs,
local_prefix, etc.) because they were only rebuilt during HTTP requests.
Extract status-building into refreshStatus() called from both paths.
Add per-client RX status MQTT events (client/{callsign}/rx) published on
every signal strength update, supporting multiple receivers per node.
This commit is contained in:
1 parent
4a9cba6edb
commit
a2eefac1f2
8 files changed
+86
-18
No files matched your search
@@ -267,6 +267,16 @@ void MqttPublisher::onTrunkDown(const std::string& section,
|
||||
}
|
||||
|
||||
|
||||
void MqttPublisher::onRxUpdate(const std::string& callsign,
|
||||
const Json::Value& rx_json)
|
||||
{
|
||||
Json::StreamWriterBuilder wb;
|
||||
wb["indentation"] = "";
|
||||
string topic = "client/" + callsign + "/rx";
|
||||
publish(topic, Json::writeString(wb, rx_json));
|
||||
}
|
||||
|
||||
|
||||
void MqttPublisher::publishFullStatus(const Json::Value& status)
|
||||
{
|
||||
Json::StreamWriterBuilder wb;
|
||||
|
||||
Reference in new issue
Block a user