|
|
@ -216,6 +216,7 @@ int CDGIdGateway::run()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int currentDGId = 0U;
|
|
|
|
unsigned int currentDGId = 0U;
|
|
|
|
|
|
|
|
bool fromRF = false;
|
|
|
|
|
|
|
|
|
|
|
|
CDGIdNetwork* dgIdNetwork[100U];
|
|
|
|
CDGIdNetwork* dgIdNetwork[100U];
|
|
|
|
for (unsigned int i = 0U; i < 100U; i++)
|
|
|
|
for (unsigned int i = 0U; i < 100U; i++)
|
|
|
@ -397,6 +398,7 @@ int CDGIdGateway::run()
|
|
|
|
createGPS();
|
|
|
|
createGPS();
|
|
|
|
|
|
|
|
|
|
|
|
CTimer inactivityTimer(1000U);
|
|
|
|
CTimer inactivityTimer(1000U);
|
|
|
|
|
|
|
|
CTimer bleepTimer(1000U, 1U);
|
|
|
|
|
|
|
|
|
|
|
|
CStopWatch stopWatch;
|
|
|
|
CStopWatch stopWatch;
|
|
|
|
stopWatch.start();
|
|
|
|
stopWatch.start();
|
|
|
@ -438,6 +440,7 @@ int CDGIdGateway::run()
|
|
|
|
LogMessage("DG-ID set to %u (%s) via RF", dgId, desc.c_str());
|
|
|
|
LogMessage("DG-ID set to %u (%s) via RF", dgId, desc.c_str());
|
|
|
|
currentDGId = dgId;
|
|
|
|
currentDGId = dgId;
|
|
|
|
state = DS_NOTLINKED;
|
|
|
|
state = DS_NOTLINKED;
|
|
|
|
|
|
|
|
fromRF = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (m_gps != NULL)
|
|
|
|
if (m_gps != NULL)
|
|
|
@ -464,10 +467,8 @@ int CDGIdGateway::run()
|
|
|
|
if ((buffer[34U] & 0x01U) == 0x01U) {
|
|
|
|
if ((buffer[34U] & 0x01U) == 0x01U) {
|
|
|
|
if (m_gps != NULL)
|
|
|
|
if (m_gps != NULL)
|
|
|
|
m_gps->reset();
|
|
|
|
m_gps->reset();
|
|
|
|
if (nPips > 0U) {
|
|
|
|
if (nPips > 0U && fromRF)
|
|
|
|
sendPips(nPips);
|
|
|
|
bleepTimer.start();
|
|
|
|
nPips = 0U;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -493,6 +494,7 @@ int CDGIdGateway::run()
|
|
|
|
LogMessage("DG-ID set to %u (%s) via Network", i, desc.c_str());
|
|
|
|
LogMessage("DG-ID set to %u (%s) via Network", i, desc.c_str());
|
|
|
|
currentDGId = i;
|
|
|
|
currentDGId = i;
|
|
|
|
state = DS_LINKED;
|
|
|
|
state = DS_LINKED;
|
|
|
|
|
|
|
|
fromRF = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -526,14 +528,25 @@ int CDGIdGateway::run()
|
|
|
|
state = DS_NOTLINKED;
|
|
|
|
state = DS_NOTLINKED;
|
|
|
|
currentDGId = 0U;
|
|
|
|
currentDGId = 0U;
|
|
|
|
inactivityTimer.stop();
|
|
|
|
inactivityTimer.stop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fromRF) {
|
|
|
|
sendPips(2U);
|
|
|
|
sendPips(2U);
|
|
|
|
|
|
|
|
fromRF = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bleepTimer.clock(ms);
|
|
|
|
|
|
|
|
if (bleepTimer.isRunning() && bleepTimer.hasExpired()) {
|
|
|
|
|
|
|
|
sendPips(nPips);
|
|
|
|
|
|
|
|
bleepTimer.stop();
|
|
|
|
|
|
|
|
nPips = 0U;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (dgIdNetwork[currentDGId] != NULL) {
|
|
|
|
if (dgIdNetwork[currentDGId] != NULL) {
|
|
|
|
DGID_STATUS netState = dgIdNetwork[currentDGId]->getStatus();
|
|
|
|
DGID_STATUS netState = dgIdNetwork[currentDGId]->getStatus();
|
|
|
|
if (state != DS_LINKED && netState == DS_LINKED)
|
|
|
|
if (fromRF && state != DS_LINKED && netState == DS_LINKED)
|
|
|
|
nPips = 1U;
|
|
|
|
nPips = 1U;
|
|
|
|
else if (state == DS_LINKED && netState != DS_LINKED)
|
|
|
|
else if (fromRF && state == DS_LINKED && netState != DS_LINKED)
|
|
|
|
nPips = 3U;
|
|
|
|
nPips = 3U;
|
|
|
|
state = netState;
|
|
|
|
state = netState;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -665,5 +678,10 @@ std::string CDGIdGateway::calculateLocator()
|
|
|
|
|
|
|
|
|
|
|
|
void CDGIdGateway::sendPips(unsigned int n)
|
|
|
|
void CDGIdGateway::sendPips(unsigned int n)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (n == 0U)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool bleep = m_conf.getBleep();
|
|
|
|
|
|
|
|
if (bleep)
|
|
|
|
LogMessage("*** %u bleep!", n);
|
|
|
|
LogMessage("*** %u bleep!", n);
|
|
|
|
}
|
|
|
|
}
|
|
|
|