feat(mqtt): peer-namespaced talker topics

External (peer-side) talker events move from flat talker/<tg>/start
with is_trunk=true to peer/<peer_id>/talker/<tg>/start. Local-only
talker/<tg>/start retains today's behavior.

To carry peer_id through the signal path: add peer_id as a 4th
argument to TGHandler::trunkTalkerUpdated; reorder
clearTrunkTalkerForTG / clearTrunkTalkersForPeer / clearAllTrunkTalkers
so the signal fires before m_trunk_talker_peer_ids is erased;
pre-populate m_trunk_talker_peer_ids in setTrunkTalkerForTGViaPeer
before calling the inner setter; switch TrunkLink::handleMsgPeerTalkerStart
from setTrunkTalkerForTG to setTrunkTalkerForTGViaPeer.

Reasons: dashboards subscribing across the mesh can now use
peer/+/talker/+/start to enumerate peer talkers without parsing the
is_trunk payload flag, and the namespacing aligns with the new
peer/<peer_id>/client/<call>/* topics added in Tasks 5-6.
This commit is contained in:
Audric committed 2026-04-28 19:45:08 +02:00
1 parent 81672bae23
commit af746d7534
8 files changed
+105 -34

No files matched your search

+9 -1
View File
@@ -23,10 +23,16 @@ class MqttPublisher
bool initialize(void);
void shutdown(void);
// Talker events (local clients and trunk peers)
// Talker events (local clients)
void onTalkerStart(uint32_t tg, const std::string& callsign, bool is_trunk);
void onTalkerStop(uint32_t tg, const std::string& callsign, bool is_trunk);
// Talker events (peer/trunk side) — published to peer/<peer_id>/talker/<tg>/start|stop
void onPeerTalkerStart(const std::string& peer_id, uint32_t tg,
const std::string& callsign);
void onPeerTalkerStop(const std::string& peer_id, uint32_t tg,
const std::string& callsign);
// Client events
void onClientConnected(const std::string& callsign, uint32_t tg,
const std::string& ip);
@@ -109,6 +115,8 @@ class MqttPublisher
void shutdown(void) {}
void onTalkerStart(uint32_t, const std::string&, bool) {}
void onTalkerStop(uint32_t, const std::string&, bool) {}
void onPeerTalkerStart(const std::string&, uint32_t, const std::string&) {}
void onPeerTalkerStop(const std::string&, uint32_t, const std::string&) {}
void onClientConnected(const std::string&, uint32_t,
const std::string&) {}
void onClientDisconnected(const std::string&) {}