mirror of
https://github.com/ShaYmez/P25Clients.git
synced 2024-11-25 05:38:39 -05:00
Merge pull request #11 from KR0SIV/patch-2
Revert to startup TG after timeout
This commit is contained in:
commit
8be8172a8a
@ -343,7 +343,8 @@ void CP25Gateway::run()
|
|||||||
|
|
||||||
inactivityTimer.clock(ms);
|
inactivityTimer.clock(ms);
|
||||||
if (inactivityTimer.isRunning() && inactivityTimer.hasExpired()) {
|
if (inactivityTimer.isRunning() && inactivityTimer.hasExpired()) {
|
||||||
if (currentId != 9999U) {
|
unsigned int startId = m_conf.getNetworkStartup();
|
||||||
|
if (currentId != startId) {
|
||||||
LogMessage("Unlinking from %u due to inactivity", currentId);
|
LogMessage("Unlinking from %u due to inactivity", currentId);
|
||||||
|
|
||||||
remoteNetwork.writeUnlink(currentAddr, currentPort);
|
remoteNetwork.writeUnlink(currentAddr, currentPort);
|
||||||
@ -356,6 +357,24 @@ void CP25Gateway::run()
|
|||||||
|
|
||||||
pollTimer.stop();
|
pollTimer.stop();
|
||||||
lostTimer.stop();
|
lostTimer.stop();
|
||||||
|
inactivityTimer.stop();
|
||||||
|
|
||||||
|
//Connecting to default startup reflector
|
||||||
|
|
||||||
|
CP25Reflector* reflector = reflectors.find(startId);
|
||||||
|
currentAddr = reflector->m_address;
|
||||||
|
currentPort = reflector->m_port;
|
||||||
|
|
||||||
|
remoteNetwork.writePoll(currentAddr, currentPort);
|
||||||
|
remoteNetwork.writePoll(currentAddr, currentPort);
|
||||||
|
remoteNetwork.writePoll(currentAddr, currentPort);
|
||||||
|
|
||||||
|
LogMessage("Linked to startup %u due to inactivity", startId);
|
||||||
|
|
||||||
|
inactivityTimer.start();
|
||||||
|
pollTimer.start();
|
||||||
|
lostTimer.start();
|
||||||
|
currentId = startId;
|
||||||
}
|
}
|
||||||
|
|
||||||
inactivityTimer.stop();
|
inactivityTimer.stop();
|
||||||
|
Loading…
Reference in New Issue
Block a user