mirror of
https://github.com/ShaYmez/NXDNClients.git
synced 2025-02-21 04:58:38 -05:00
Fix Static on startup.
If a static talkgroup is set in the configuration file is set, some 3 poll frames are sent, but replies are ignored, hence the connection status stays disconnected, and localnetwork won't get any data also.
This commit is contained in:
parent
f907b4ce3c
commit
a69af8ad79
@ -313,9 +313,11 @@ void CNXDNGateway::run()
|
|||||||
hangTimer.start();
|
hangTimer.start();
|
||||||
}
|
}
|
||||||
} else if (currentTG == 0U) {
|
} else if (currentTG == 0U) {
|
||||||
// Don't pass reflector control data through to the MMDVM
|
bool poll = false;
|
||||||
if (::memcmp(buffer, "NXDND", 5U) == 0) {
|
|
||||||
// Find the static TG that this audio data belongs to
|
// We weren't really connected yet, but we got a reply from a poll, or some data
|
||||||
|
if ((::memcmp(buffer, "NXDND", 5U) == 0) || (poll = (::memcmp(buffer, "NXDNP", 5U) == 0))) {
|
||||||
|
// Find the static TG that this audio data/poll belongs to
|
||||||
for (std::vector<CStaticTG>::const_iterator it = staticTGs.cbegin(); it != staticTGs.cend(); ++it) {
|
for (std::vector<CStaticTG>::const_iterator it = staticTGs.cbegin(); it != staticTGs.cend(); ++it) {
|
||||||
if (CUDPSocket::match(addr, (*it).m_addr)) {
|
if (CUDPSocket::match(addr, (*it).m_addr)) {
|
||||||
currentTG = (*it).m_tg;
|
currentTG = (*it).m_tg;
|
||||||
@ -334,7 +336,7 @@ void CNXDNGateway::run()
|
|||||||
|
|
||||||
bool grp = (buffer[9U] & 0x01U) == 0x01U;
|
bool grp = (buffer[9U] & 0x01U) == 0x01U;
|
||||||
|
|
||||||
if (grp && currentTG == dstTG)
|
if (grp && currentTG == dstTG && (poll == false))
|
||||||
localNetwork->write(buffer + 10U, len - 10U);
|
localNetwork->write(buffer + 10U, len - 10U);
|
||||||
|
|
||||||
LogMessage("Switched to reflector %u due to network activity", currentTG);
|
LogMessage("Switched to reflector %u due to network activity", currentTG);
|
||||||
|
Loading…
Reference in New Issue
Block a user