Add MobileGPS support for DMR.

This commit is contained in:
Jonathan Naylor
2018-11-06 12:14:57 +00:00
parent 2caa2e9a67
commit e847711d17
16 changed files with 255 additions and 12 deletions

View File

@@ -55,7 +55,8 @@ enum SECTION {
SECTION_NEXTION,
SECTION_OLED,
SECTION_LCDPROC,
SECTION_LOCK_FILE
SECTION_LOCK_FILE,
SECTION_MOBILE_GPS
};
CConf::CConf(const std::string& file) :
@@ -242,7 +243,10 @@ m_lcdprocLocalPort(0U),
m_lcdprocDisplayClock(false),
m_lcdprocUTC(false),
m_lockFileEnabled(false),
m_lockFileName()
m_lockFileName(),
m_mobileGPSEnabled(false),
m_mobileGPSAddress(),
m_mobileGPSPort(0U)
{
}
@@ -320,6 +324,8 @@ bool CConf::read()
section = SECTION_LCDPROC;
else if (::strncmp(buffer, "[Lock File]", 11U) == 0)
section = SECTION_LOCK_FILE;
else if (::strncmp(buffer, "[Mobile GPS]", 12U) == 0)
section = SECTION_MOBILE_GPS;
else
section = SECTION_NONE;
@@ -800,6 +806,13 @@ bool CConf::read()
m_lockFileEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "File") == 0)
m_lockFileName = value;
} else if (section == SECTION_MOBILE_GPS) {
if (::strcmp(key, "Enable") == 0)
m_mobileGPSEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Address") == 0)
m_mobileGPSAddress = value;
else if (::strcmp(key, "Port") == 0)
m_mobileGPSPort = (unsigned int)::atoi(value);
}
}
@@ -1727,3 +1740,19 @@ std::string CConf::getLockFileName() const
{
return m_lockFileName;
}
bool CConf::getMobileGPSEnabled() const
{
return m_mobileGPSEnabled;
}
std::string CConf::getMobileGPSAddress() const
{
return m_mobileGPSAddress;
}
unsigned int CConf::getMobileGPSPort() const
{
return m_mobileGPSPort;
}