TwinLink: mirror external trunk-talker state to partner

When TrunkLink receives MsgTrunkTalkerStart/Stop from an external peer,
Reflector now forwards those events to TwinLink via
notifyExternalTrunkTalkerStart/Stop.  TwinLink sends MsgTwinExtTalkerStart
(type 123) / MsgTwinExtTalkerStop (type 124) over the twin link, and the
receiving side calls TGHandler::setTrunkTalkerForTGViaPeer so the partner
twin blocks local clients from keying up the TG.  On disconnect,
clearPeerTalkerState iterates held TGs before clearing them so the partner
is also notified.  No echo loop: Reflector::onTrunkTalkerUpdated does not
feed back into TwinLink.
This commit is contained in:
Audric committed 2026-04-15 21:30:14 +02:00
1 parent 2554efb392
commit 6fb5aa4b91
4 files changed
+54 -11

No files matched your search

+3
View File
@@ -832,6 +832,7 @@ void TrunkLink::handleMsgTrunkTalkerStart(std::istream& is)
m_peer_active_tgs.insert(local_tg);
m_peer_interested_tgs[local_tg] = std::time(nullptr);
TGHandler::instance()->setTrunkTalkerForTG(local_tg, msg.callsign());
m_reflector->notifyExternalTrunkTalkerStart(local_tg, m_section, msg.callsign());
} /* TrunkLink::handleMsgTrunkTalkerStart */
@@ -860,6 +861,7 @@ void TrunkLink::handleMsgTrunkTalkerStop(std::istream& is)
m_yielded_tgs.erase(local_tg);
m_peer_active_tgs.erase(local_tg);
TGHandler::instance()->clearTrunkTalkerForTG(local_tg);
m_reflector->notifyExternalTrunkTalkerStop(local_tg, m_section);
} /* TrunkLink::handleMsgTrunkTalkerStop */
@@ -1093,6 +1095,7 @@ void TrunkLink::clearPeerTalkerState(void)
for (uint32_t tg : m_peer_active_tgs)
{
TGHandler::instance()->clearTrunkTalkerForTG(tg);
m_reflector->notifyExternalTrunkTalkerStop(tg, m_section);
}
m_peer_active_tgs.clear();
m_yielded_tgs.clear();