mirror of
https://github.com/ShaYmez/P25Clients.git
synced 2025-09-08 16:17:46 -04:00
Fix bugs.
This commit is contained in:
parent
adb4ab511d
commit
4fc0085b8c
@ -273,7 +273,7 @@ void CP25Gateway::run()
|
|||||||
unsigned int len = remoteNetwork.readData(buffer, 200U, addr, addrLen);
|
unsigned int len = remoteNetwork.readData(buffer, 200U, addr, addrLen);
|
||||||
if (len > 0U) {
|
if (len > 0U) {
|
||||||
// If we're linked and it's from the right place, send it on
|
// If we're linked and it's from the right place, send it on
|
||||||
if (currentTG > 0U && CUDPSocket::match(currentAddr, addr)) {
|
if (currentAddrLen > 0U && CUDPSocket::match(currentAddr, addr)) {
|
||||||
// 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) {
|
||||||
// Rewrite the LCF and the destination TG
|
// Rewrite the LCF and the destination TG
|
||||||
@ -338,7 +338,7 @@ void CP25Gateway::run()
|
|||||||
srcId |= (buffer[3U] << 0) & 0x0000FFU;
|
srcId |= (buffer[3U] << 0) & 0x0000FFU;
|
||||||
|
|
||||||
if (dstTG != currentTG) {
|
if (dstTG != currentTG) {
|
||||||
if (currentTG > 0U) {
|
if (currentAddrLen > 0U) {
|
||||||
std::string callsign = lookup->find(srcId);
|
std::string callsign = lookup->find(srcId);
|
||||||
LogMessage("Unlinking from reflector %u by %s", currentTG, callsign.c_str());
|
LogMessage("Unlinking from reflector %u by %s", currentTG, callsign.c_str());
|
||||||
|
|
||||||
@ -359,9 +359,6 @@ void CP25Gateway::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
currentTG = 0U;
|
|
||||||
currentAddrLen = 0U;
|
|
||||||
|
|
||||||
if (found == NULL) {
|
if (found == NULL) {
|
||||||
CP25Reflector* refl = reflectors.find(dstTG);
|
CP25Reflector* refl = reflectors.find(dstTG);
|
||||||
if (refl != NULL) {
|
if (refl != NULL) {
|
||||||
@ -369,6 +366,10 @@ void CP25Gateway::run()
|
|||||||
currentAddr = refl->m_addr;
|
currentAddr = refl->m_addr;
|
||||||
currentAddrLen = refl->m_addrLen;
|
currentAddrLen = refl->m_addrLen;
|
||||||
currentIsStatic = false;
|
currentIsStatic = false;
|
||||||
|
} else {
|
||||||
|
currentTG = dstTG;
|
||||||
|
currentAddrLen = 0U;
|
||||||
|
currentIsStatic = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
currentTG = found->m_tg;
|
currentTG = found->m_tg;
|
||||||
@ -393,12 +394,11 @@ void CP25Gateway::run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (voice != NULL) {
|
if (voice != NULL) {
|
||||||
if (currentTG == 0U)
|
if (currentAddrLen == 0U)
|
||||||
voice->unlinked();
|
voice->unlinked();
|
||||||
else
|
else
|
||||||
voice->linkedTo(dstTG);
|
voice->linkedTo(dstTG);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,7 +408,7 @@ void CP25Gateway::run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we're linked and we have a network, send it on
|
// If we're linked and we have a network, send it on
|
||||||
if (currentTG > 0U) {
|
if (currentAddrLen > 0U) {
|
||||||
// Rewrite the LCF and the destination TG
|
// Rewrite the LCF and the destination TG
|
||||||
if (buffer[0U] == 0x64U) {
|
if (buffer[0U] == 0x64U) {
|
||||||
buffer[1U] = 0x00U; // LCF is for TGs
|
buffer[1U] = 0x00U; // LCF is for TGs
|
||||||
@ -439,7 +439,9 @@ void CP25Gateway::run()
|
|||||||
|
|
||||||
hangTimer.clock(ms);
|
hangTimer.clock(ms);
|
||||||
if (hangTimer.isRunning() && hangTimer.hasExpired()) {
|
if (hangTimer.isRunning() && hangTimer.hasExpired()) {
|
||||||
if (currentTG > 0U) {
|
currentTG = 0U;
|
||||||
|
|
||||||
|
if (currentAddrLen > 0U) {
|
||||||
LogMessage("Unlinking from %u due to inactivity", currentTG);
|
LogMessage("Unlinking from %u due to inactivity", currentTG);
|
||||||
|
|
||||||
if (!currentIsStatic) {
|
if (!currentIsStatic) {
|
||||||
@ -451,7 +453,6 @@ void CP25Gateway::run()
|
|||||||
if (voice != NULL)
|
if (voice != NULL)
|
||||||
voice->unlinked();
|
voice->unlinked();
|
||||||
|
|
||||||
currentTG = 0U;
|
|
||||||
currentAddrLen = 0U;
|
currentAddrLen = 0U;
|
||||||
|
|
||||||
hangTimer.stop();
|
hangTimer.stop();
|
||||||
|
@ -19,6 +19,6 @@
|
|||||||
#if !defined(VERSION_H)
|
#if !defined(VERSION_H)
|
||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
|
||||||
const char* VERSION = "20201026";
|
const char* VERSION = "20201027";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user