fix(twin): notify twin partner of satellite-originated talker traffic
SatelliteLink::handleMsgPeer{TalkerStart,TalkerStop,Audio,Flush} now
inform the twin partner the same way local-client TX already does
(Reflector.cpp:1433/1499/1662). Adds Reflector::forwardSatellite*ToTwin
helpers (one per event, guarded by m_twin_link != nullptr) that delegate
to TwinLink's existing onLocal* API; the satellite is presented to the
twin as a downstream-local talker, mirroring how it's already presented
to trunk peers via the parallel forwardSatellite*ToTrunks family.
Fixes issue #7. test_X3_satellite_tx_reaches_twin_partner (added in
the previous commit) now passes; full integration suite 73/73 green.
This commit is contained in:
1 parent
303186b083
commit
ace9da635b
3 files changed
+57
No files matched your search
@@ -2813,6 +2813,44 @@ void Reflector::forwardSatelliteFlushToTrunks(uint32_t tg)
|
|||||||
} /* Reflector::forwardSatelliteFlushToTrunks */
|
} /* Reflector::forwardSatelliteFlushToTrunks */
|
||||||
|
|
||||||
|
|
||||||
|
void Reflector::forwardSatelliteAudioToTwin(uint32_t tg,
|
||||||
|
const std::string& callsign)
|
||||||
|
{
|
||||||
|
if (m_twin_link != nullptr)
|
||||||
|
{
|
||||||
|
m_twin_link->onLocalTalkerUpdated(tg, callsign);
|
||||||
|
}
|
||||||
|
} /* Reflector::forwardSatelliteAudioToTwin */
|
||||||
|
|
||||||
|
|
||||||
|
void Reflector::forwardSatelliteStopToTwin(uint32_t tg)
|
||||||
|
{
|
||||||
|
if (m_twin_link != nullptr)
|
||||||
|
{
|
||||||
|
m_twin_link->onLocalTalkerUpdated(tg, "");
|
||||||
|
}
|
||||||
|
} /* Reflector::forwardSatelliteStopToTwin */
|
||||||
|
|
||||||
|
|
||||||
|
void Reflector::forwardSatelliteRawAudioToTwin(uint32_t tg,
|
||||||
|
const std::vector<uint8_t>& audio)
|
||||||
|
{
|
||||||
|
if (m_twin_link != nullptr)
|
||||||
|
{
|
||||||
|
m_twin_link->onLocalAudio(tg, audio);
|
||||||
|
}
|
||||||
|
} /* Reflector::forwardSatelliteRawAudioToTwin */
|
||||||
|
|
||||||
|
|
||||||
|
void Reflector::forwardSatelliteFlushToTwin(uint32_t tg)
|
||||||
|
{
|
||||||
|
if (m_twin_link != nullptr)
|
||||||
|
{
|
||||||
|
m_twin_link->onLocalFlush(tg);
|
||||||
|
}
|
||||||
|
} /* Reflector::forwardSatelliteFlushToTwin */
|
||||||
|
|
||||||
|
|
||||||
void Reflector::forwardAudioToSatellitesExcept(SatelliteLink* except,
|
void Reflector::forwardAudioToSatellitesExcept(SatelliteLink* except,
|
||||||
uint32_t tg, const std::vector<uint8_t>& audio)
|
uint32_t tg, const std::vector<uint8_t>& audio)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -294,6 +294,15 @@ class Reflector : public sigc::trackable
|
|||||||
void forwardSatelliteRawAudioToTrunks(uint32_t tg,
|
void forwardSatelliteRawAudioToTrunks(uint32_t tg,
|
||||||
const std::vector<uint8_t>& audio);
|
const std::vector<uint8_t>& audio);
|
||||||
void forwardSatelliteFlushToTrunks(uint32_t tg);
|
void forwardSatelliteFlushToTrunks(uint32_t tg);
|
||||||
|
// Same family, twin destination. Treat the satellite talker as a
|
||||||
|
// local-to-this-reflector talker from the twin partner's perspective
|
||||||
|
// (matches how trunks see it via the ToTrunks family above).
|
||||||
|
void forwardSatelliteAudioToTwin(uint32_t tg,
|
||||||
|
const std::string& callsign);
|
||||||
|
void forwardSatelliteStopToTwin(uint32_t tg);
|
||||||
|
void forwardSatelliteRawAudioToTwin(uint32_t tg,
|
||||||
|
const std::vector<uint8_t>& audio);
|
||||||
|
void forwardSatelliteFlushToTwin(uint32_t tg);
|
||||||
void forwardAudioToSatellitesExcept(SatelliteLink* except, uint32_t tg,
|
void forwardAudioToSatellitesExcept(SatelliteLink* except, uint32_t tg,
|
||||||
const std::vector<uint8_t>& audio);
|
const std::vector<uint8_t>& audio);
|
||||||
void forwardFlushToSatellitesExcept(SatelliteLink* except, uint32_t tg);
|
void forwardFlushToSatellitesExcept(SatelliteLink* except, uint32_t tg);
|
||||||
|
|||||||
@@ -345,6 +345,9 @@ void SatelliteLink::handleMsgPeerTalkerStart(std::istream& is)
|
|||||||
// Forward to trunk peers
|
// Forward to trunk peers
|
||||||
m_reflector->forwardSatelliteAudioToTrunks(tg, msg.callsign());
|
m_reflector->forwardSatelliteAudioToTrunks(tg, msg.callsign());
|
||||||
|
|
||||||
|
// Forward to the twin partner (the satellite is downstream-local to us)
|
||||||
|
m_reflector->forwardSatelliteAudioToTwin(tg, msg.callsign());
|
||||||
|
|
||||||
statusChanged(this);
|
statusChanged(this);
|
||||||
} /* SatelliteLink::handleMsgPeerTalkerStart */
|
} /* SatelliteLink::handleMsgPeerTalkerStart */
|
||||||
|
|
||||||
@@ -361,6 +364,9 @@ void SatelliteLink::handleMsgPeerTalkerStop(std::istream& is)
|
|||||||
// Forward stop to trunk peers
|
// Forward stop to trunk peers
|
||||||
m_reflector->forwardSatelliteStopToTrunks(tg);
|
m_reflector->forwardSatelliteStopToTrunks(tg);
|
||||||
|
|
||||||
|
// Forward stop to the twin partner
|
||||||
|
m_reflector->forwardSatelliteStopToTwin(tg);
|
||||||
|
|
||||||
statusChanged(this);
|
statusChanged(this);
|
||||||
} /* SatelliteLink::handleMsgPeerTalkerStop */
|
} /* SatelliteLink::handleMsgPeerTalkerStop */
|
||||||
|
|
||||||
@@ -386,6 +392,9 @@ void SatelliteLink::handleMsgPeerAudio(std::istream& is)
|
|||||||
// Forward to trunk peers
|
// Forward to trunk peers
|
||||||
m_reflector->forwardSatelliteRawAudioToTrunks(tg, msg.audio());
|
m_reflector->forwardSatelliteRawAudioToTrunks(tg, msg.audio());
|
||||||
|
|
||||||
|
// Forward to the twin partner
|
||||||
|
m_reflector->forwardSatelliteRawAudioToTwin(tg, msg.audio());
|
||||||
|
|
||||||
// Forward to other satellites (not this one)
|
// Forward to other satellites (not this one)
|
||||||
m_reflector->forwardAudioToSatellitesExcept(this, tg, msg.audio());
|
m_reflector->forwardAudioToSatellitesExcept(this, tg, msg.audio());
|
||||||
} /* SatelliteLink::handleMsgPeerAudio */
|
} /* SatelliteLink::handleMsgPeerAudio */
|
||||||
@@ -406,6 +415,7 @@ void SatelliteLink::handleMsgPeerFlush(std::istream& is)
|
|||||||
ReflectorClient::SelectedTgIdleFilter())));
|
ReflectorClient::SelectedTgIdleFilter())));
|
||||||
|
|
||||||
m_reflector->forwardSatelliteFlushToTrunks(tg);
|
m_reflector->forwardSatelliteFlushToTrunks(tg);
|
||||||
|
m_reflector->forwardSatelliteFlushToTwin(tg);
|
||||||
m_reflector->forwardFlushToSatellitesExcept(this, tg);
|
m_reflector->forwardFlushToSatellitesExcept(this, tg);
|
||||||
} /* SatelliteLink::handleMsgPeerFlush */
|
} /* SatelliteLink::handleMsgPeerFlush */
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user