Add experimental RT8 GPS data handling.

This commit is contained in:
Jonathan Naylor
2017-05-30 14:30:05 +01:00
parent 8bc79767c5
commit aa063ff205
21 changed files with 61859 additions and 6 deletions

View File

@@ -30,6 +30,8 @@ enum SECTION {
SECTION_NONE,
SECTION_GENERAL,
SECTION_LOG,
SECTION_DMRID_LOOKUP,
SECTION_APRS_FI,
SECTION_VOICE,
SECTION_DMR_NETWORK_1,
SECTION_DMR_NETWORK_2,
@@ -53,6 +55,12 @@ m_logDisplayLevel(0U),
m_logFileLevel(0U),
m_logFilePath(),
m_logFileRoot(),
m_dmrIdLookupFile(),
m_dmrIdLookupTime(0U),
m_aprsEnabled(false),
m_aprsServer(),
m_aprsPort(0U),
m_aprsPassword(),
m_dmrNetwork1Enabled(false),
m_dmrNetwork1Id(0U),
m_dmrNetwork1Address(),
@@ -132,6 +140,10 @@ bool CConf::read()
section = SECTION_GENERAL;
else if (::strncmp(buffer, "[Log]", 5U) == 0)
section = SECTION_LOG;
else if (::strncmp(buffer, "[DMR Id Lookup]", 15U) == 0)
section = SECTION_DMRID_LOOKUP;
else if (::strncmp(buffer, "[aprs.fi]", 5U) == 0)
section = SECTION_APRS_FI;
else if (::strncmp(buffer, "[Voice]", 7U) == 0)
section = SECTION_VOICE;
else if (::strncmp(buffer, "[XLX Network 1]", 15U) == 0)
@@ -159,7 +171,17 @@ bool CConf::read()
if (section == SECTION_GENERAL) {
if (::strcmp(key, "Daemon") == 0)
m_daemon = ::atoi(value) == 1;
else if (::strcmp(key, "Timeout") == 0)
if (::strcmp(key, "Callsign") == 0) {
// Convert the callsign to upper case
for (unsigned int i = 0U; value[i] != 0; i++)
value[i] = ::toupper(value[i]);
m_callsign = value;
} else if (::strcmp(key, "Suffix") == 0) {
// Convert the callsign to upper case
for (unsigned int i = 0U; value[i] != 0; i++)
value[i] = ::toupper(value[i]);
m_suffix = value;
}else if (::strcmp(key, "Timeout") == 0)
m_timeout = (unsigned int)::atoi(value);
else if (::strcmp(key, "RptAddress") == 0)
m_rptAddress = value;
@@ -180,6 +202,20 @@ bool CConf::read()
m_logFileLevel = (unsigned int)::atoi(value);
else if (::strcmp(key, "DisplayLevel") == 0)
m_logDisplayLevel = (unsigned int)::atoi(value);
} else if (section == SECTION_DMRID_LOOKUP) {
if (::strcmp(key, "File") == 0)
m_dmrIdLookupFile = value;
else if (::strcmp(key, "Time") == 0)
m_dmrIdLookupTime = (unsigned int)::atoi(value);
} else if (section == SECTION_APRS_FI) {
if (::strcmp(key, "Enable") == 0)
m_aprsEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Server") == 0)
m_aprsServer = value;
else if (::strcmp(key, "Port") == 0)
m_aprsPort = (unsigned int)::atoi(value);
else if (::strcmp(key, "Password") == 0)
m_aprsPassword = value;
} else if (section == SECTION_VOICE) {
if (::strcmp(key, "Enabled") == 0)
m_voiceEnabled = ::atoi(value) == 1;
@@ -409,11 +445,22 @@ bool CConf::read()
return true;
}
std::string CConf::getCallsign() const
{
return m_callsign;
}
std::string CConf::getSuffix() const
{
return m_suffix;
}
bool CConf::getDaemon() const
{
return m_daemon;
}
std::string CConf::getRptAddress() const
{
return m_rptAddress;
@@ -464,6 +511,37 @@ std::string CConf::getLogFileRoot() const
return m_logFileRoot;
}
std::string CConf::getDMRIdLookupFile() const
{
return m_dmrIdLookupFile;
}
unsigned int CConf::getDMRIdLookupTime() const
{
return m_dmrIdLookupTime;
}
bool CConf::getAPRSEnabled() const
{
return m_aprsEnabled;
}
std::string CConf::getAPRSServer() const
{
return m_aprsServer;
}
unsigned int CConf::getAPRSPort() const
{
return m_aprsPort;
}
std::string CConf::getAPRSPassword() const
{
return m_aprsPassword;
}
bool CConf::getVoiceEnabled() const
{
return m_voiceEnabled;