|
|
@ -201,6 +201,8 @@ int CDGIdGateway::run()
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rptNetwork.link();
|
|
|
|
|
|
|
|
|
|
|
|
std::string fileName = m_conf.getYSFNetHosts();
|
|
|
|
std::string fileName = m_conf.getYSFNetHosts();
|
|
|
|
CYSFReflectors* reflectors = new CYSFReflectors(fileName);
|
|
|
|
CYSFReflectors* reflectors = new CYSFReflectors(fileName);
|
|
|
|
reflectors->load();
|
|
|
|
reflectors->load();
|
|
|
@ -381,6 +383,7 @@ int CDGIdGateway::run()
|
|
|
|
LogMessage("Starting DGIdGateway-%s", VERSION);
|
|
|
|
LogMessage("Starting DGIdGateway-%s", VERSION);
|
|
|
|
|
|
|
|
|
|
|
|
DGID_STATUS state = DS_NOTLINKED;
|
|
|
|
DGID_STATUS state = DS_NOTLINKED;
|
|
|
|
|
|
|
|
unsigned int nPips = 0U;
|
|
|
|
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
for (;;) {
|
|
|
|
unsigned char buffer[200U];
|
|
|
|
unsigned char buffer[200U];
|
|
|
@ -411,7 +414,7 @@ int CDGIdGateway::run()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::string desc = dgIdNetwork[dgId]->getDesc(dgId);
|
|
|
|
std::string desc = dgIdNetwork[dgId]->getDesc(dgId);
|
|
|
|
LogDebug("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;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -440,6 +443,10 @@ 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) {
|
|
|
|
|
|
|
|
sendPips(nPips);
|
|
|
|
|
|
|
|
nPips = 0U;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -462,7 +469,7 @@ int CDGIdGateway::run()
|
|
|
|
|
|
|
|
|
|
|
|
if (currentDGId == 0U) {
|
|
|
|
if (currentDGId == 0U) {
|
|
|
|
std::string desc = dgIdNetwork[i]->getDesc(i);
|
|
|
|
std::string desc = dgIdNetwork[i]->getDesc(i);
|
|
|
|
LogDebug("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;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -493,20 +500,20 @@ int CDGIdGateway::run()
|
|
|
|
dgIdNetwork[currentDGId]->unlink();
|
|
|
|
dgIdNetwork[currentDGId]->unlink();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LogDebug("DG-ID set to 0 (None) via timeout");
|
|
|
|
LogMessage("DG-ID set to 0 (None) via timeout");
|
|
|
|
|
|
|
|
|
|
|
|
state = DS_NOTLINKED;
|
|
|
|
state = DS_NOTLINKED;
|
|
|
|
currentDGId = 0U;
|
|
|
|
currentDGId = 0U;
|
|
|
|
inactivityTimer.stop();
|
|
|
|
inactivityTimer.stop();
|
|
|
|
sendPips(2U);
|
|
|
|
nPips = 2U;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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 (state != DS_LINKED && netState == DS_LINKED)
|
|
|
|
sendPips(1U);
|
|
|
|
nPips = 1U;
|
|
|
|
else if (state == DS_LINKED && netState != DS_LINKED)
|
|
|
|
else if (state == DS_LINKED && netState != DS_LINKED)
|
|
|
|
sendPips(3U);
|
|
|
|
nPips = 3U;
|
|
|
|
state = netState;
|
|
|
|
state = netState;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -514,6 +521,7 @@ int CDGIdGateway::run()
|
|
|
|
CThread::sleep(5U);
|
|
|
|
CThread::sleep(5U);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rptNetwork.unlink();
|
|
|
|
rptNetwork.close();
|
|
|
|
rptNetwork.close();
|
|
|
|
|
|
|
|
|
|
|
|
if (m_gps != NULL) {
|
|
|
|
if (m_gps != NULL) {
|
|
|
|