mirror of
https://github.com/ShaYmez/P25Clients.git
synced 2025-09-05 22:57:48 -04: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
46a2d6334d
commit
012456a340
@ -302,8 +302,18 @@ void CP25Gateway::run()
|
|||||||
hangTimer.start();
|
hangTimer.start();
|
||||||
}
|
}
|
||||||
} else if (currentTG == 0U) {
|
} else if (currentTG == 0U) {
|
||||||
|
bool poll = false;
|
||||||
|
unsigned char pollReply[11U] = { 0xF0U };
|
||||||
|
std::string callsign = m_conf.getCallsign();
|
||||||
|
|
||||||
|
callsign.resize(10U, ' ');
|
||||||
|
|
||||||
|
// Build poll reply data
|
||||||
|
for (unsigned int i = 0U; i < 10U; i++)
|
||||||
|
pollReply[i + 1U] = callsign.at(i);
|
||||||
|
|
||||||
// Don't pass reflector control data through to the MMDVM
|
// Don't pass reflector control data through to the MMDVM
|
||||||
if (buffer[0U] != 0xF0U && buffer[0U] != 0xF1U) {
|
if ((buffer[0U] != 0xF0U && buffer[0U] != 0xF1U) || (poll = (::memcmp(buffer, pollReply, std::min(11U, len)) == 0))) {
|
||||||
// Find the static TG that this audio data belongs to
|
// Find the static TG that this audio data 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)) {
|
||||||
@ -326,7 +336,8 @@ void CP25Gateway::run()
|
|||||||
buffer[3U] = (currentTG >> 0) & 0xFFU;
|
buffer[3U] = (currentTG >> 0) & 0xFFU;
|
||||||
}
|
}
|
||||||
|
|
||||||
localNetwork.write(buffer, len);
|
if (poll == false)
|
||||||
|
localNetwork.write(buffer, len);
|
||||||
|
|
||||||
LogMessage("Switched to reflector %u due to network activity", currentTG);
|
LogMessage("Switched to reflector %u due to network activity", currentTG);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user