Get the DGId Gateway working for YSF at least.
This commit is contained in:
parent
be1e3aa4fa
commit
0a4260a23c
4 changed files with 22 additions and 10 deletions
|
@ -201,6 +201,8 @@ int CDGIdGateway::run()
|
|||
return 1;
|
||||
}
|
||||
|
||||
rptNetwork.link();
|
||||
|
||||
std::string fileName = m_conf.getYSFNetHosts();
|
||||
CYSFReflectors* reflectors = new CYSFReflectors(fileName);
|
||||
reflectors->load();
|
||||
|
@ -381,6 +383,7 @@ int CDGIdGateway::run()
|
|||
LogMessage("Starting DGIdGateway-%s", VERSION);
|
||||
|
||||
DGID_STATUS state = DS_NOTLINKED;
|
||||
unsigned int nPips = 0U;
|
||||
|
||||
for (;;) {
|
||||
unsigned char buffer[200U];
|
||||
|
@ -411,7 +414,7 @@ int CDGIdGateway::run()
|
|||
}
|
||||
|
||||
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;
|
||||
state = DS_NOTLINKED;
|
||||
}
|
||||
|
@ -440,6 +443,10 @@ int CDGIdGateway::run()
|
|||
if ((buffer[34U] & 0x01U) == 0x01U) {
|
||||
if (m_gps != NULL)
|
||||
m_gps->reset();
|
||||
if (nPips > 0U) {
|
||||
sendPips(nPips);
|
||||
nPips = 0U;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -462,7 +469,7 @@ int CDGIdGateway::run()
|
|||
|
||||
if (currentDGId == 0U) {
|
||||
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;
|
||||
state = DS_LINKED;
|
||||
}
|
||||
|
@ -493,20 +500,20 @@ int CDGIdGateway::run()
|
|||
dgIdNetwork[currentDGId]->unlink();
|
||||
}
|
||||
|
||||
LogDebug("DG-ID set to 0 (None) via timeout");
|
||||
LogMessage("DG-ID set to 0 (None) via timeout");
|
||||
|
||||
state = DS_NOTLINKED;
|
||||
currentDGId = 0U;
|
||||
inactivityTimer.stop();
|
||||
sendPips(2U);
|
||||
nPips = 2U;
|
||||
}
|
||||
|
||||
if (dgIdNetwork[currentDGId] != NULL) {
|
||||
DGID_STATUS netState = dgIdNetwork[currentDGId]->getStatus();
|
||||
if (state != DS_LINKED && netState == DS_LINKED)
|
||||
sendPips(1U);
|
||||
nPips = 1U;
|
||||
else if (state == DS_LINKED && netState != DS_LINKED)
|
||||
sendPips(3U);
|
||||
nPips = 3U;
|
||||
state = netState;
|
||||
}
|
||||
|
||||
|
@ -514,6 +521,7 @@ int CDGIdGateway::run()
|
|||
CThread::sleep(5U);
|
||||
}
|
||||
|
||||
rptNetwork.unlink();
|
||||
rptNetwork.close();
|
||||
|
||||
if (m_gps != NULL) {
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;HAVE_LOG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@ -101,7 +101,7 @@
|
|||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;HAVE_LOG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@ -116,7 +116,7 @@
|
|||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;HAVE_LOG_H;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
@ -131,7 +131,7 @@
|
|||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;HAVE_LOG_H;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
|
|
@ -147,6 +147,8 @@ void CFCSNetwork::unlink()
|
|||
|
||||
m_pingTimer.stop();
|
||||
|
||||
LogMessage("Unlinked from %s", m_print.c_str());
|
||||
|
||||
m_state = DS_NOTLINKED;
|
||||
}
|
||||
|
||||
|
|
|
@ -189,6 +189,8 @@ void CYSFNetwork::unlink()
|
|||
|
||||
m_socket.write(m_unlink, 14U, m_addr, m_addrLen);
|
||||
|
||||
LogMessage("Unlinked from %s", m_name.c_str());
|
||||
|
||||
m_state = DS_NOTLINKED;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue