1
0
Fork 0

Add global IMRS parameters.

ycs232-kbc
Jonathan Naylor 4 years ago
parent da049dfcfb
commit 4457fb8e9e

@ -35,6 +35,7 @@ enum SECTION {
SECTION_APRS,
SECTION_YSF_NETWORK,
SECTION_FCS_NETWORK,
SECTION_IMRS_NETWORK,
SECTION_DGID,
SECTION_GPSD
};
@ -76,6 +77,9 @@ m_ysfNetDebug(false),
m_fcsRFHangTime(60U),
m_fcsNetHangTime(60U),
m_fcsNetDebug(false),
m_imrsRFHangTime(240U),
m_imrsNetHangTime(240U),
m_imrsNetDebug(false),
m_dgIdData(),
m_gpsdEnabled(false),
m_gpsdAddress(),
@ -117,6 +121,8 @@ bool CConf::read()
section = SECTION_YSF_NETWORK;
else if (::strncmp(buffer, "[FCS Network]", 13U) == 0)
section = SECTION_FCS_NETWORK;
else if (::strncmp(buffer, "[IMRS Network]", 14U) == 0)
section = SECTION_IMRS_NETWORK;
else if (::strncmp(buffer, "[DGId=", 6U) == 0) {
section = SECTION_DGID;
dgIdData = new DGIdData;
@ -237,6 +243,13 @@ bool CConf::read()
m_fcsNetHangTime = (unsigned int)::atoi(value);
else if (::strcmp(key, "Debug") == 0)
m_fcsNetDebug = ::atoi(value) == 1;
} else if (section == SECTION_IMRS_NETWORK) {
if (::strcmp(key, "RFHangTime") == 0)
m_imrsRFHangTime = (unsigned int)::atoi(value);
else if (::strcmp(key, "NetHangTime") == 0)
m_imrsNetHangTime = (unsigned int)::atoi(value);
else if (::strcmp(key, "Debug") == 0)
m_imrsNetDebug = ::atoi(value) == 1;
} else if (section == SECTION_DGID) {
assert(dgIdData != NULL);
if (::strcmp(key, "Type") == 0) {
@ -254,6 +267,10 @@ bool CConf::read()
dgIdData->m_rfHangTime = m_ysfRFHangTime;
dgIdData->m_netHangTime = m_ysfNetHangTime;
dgIdData->m_debug = m_ysfNetDebug;
} else if (::strcmp(value, "IMRS") == 0) {
dgIdData->m_rfHangTime = m_imrsRFHangTime;
dgIdData->m_netHangTime = m_imrsNetHangTime;
dgIdData->m_debug = m_imrsNetDebug;
} else {
dgIdData->m_rfHangTime = m_rfHangTime;
dgIdData->m_netHangTime = m_netHangTime;

@ -138,6 +138,10 @@ private:
unsigned int m_fcsNetHangTime;
bool m_fcsNetDebug;
unsigned int m_imrsRFHangTime;
unsigned int m_imrsNetHangTime;
bool m_imrsNetDebug;
std::vector<DGIdData*> m_dgIdData;
bool m_gpsdEnabled;

@ -47,6 +47,11 @@ RFHangTime=120
NetHangTime=60
Debug=0
[IMRS Network]
RFHangTime=240
NetHangTime=240
Debug=0
[DGId=1]
# YSF Local Parrot
Type=Parrot
@ -149,8 +154,8 @@ Type=IMRS
Name=South Coast
Destination=100,44.131.4.1
Destination=75,44.131.4.2
RFHangTime=240
NetHangTime=240
#RFHangTime=240
#NetHangTime=240
Debug=0
[GPSD]

@ -99,7 +99,7 @@ void CIMRSNetwork::write(unsigned int dgId, const unsigned char* data)
switch (fich.getFI()) {
case YSF_FI_HEADER:
case YSF_FI_TERMINATOR:
case YSF_FI_TERMINATOR:
writeHeaderTrailer(ptr, fich, data);
break;
case YSF_FI_COMMUNICATIONS:

@ -19,6 +19,6 @@
#if !defined(VERSION_H)
#define VERSION_H
const char* VERSION = "20200924";
const char* VERSION = "20200925";
#endif

Loading…
Cancel
Save