Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into mmdvmHsDualHat
Browse files Browse the repository at this point in the history
  • Loading branch information
phl0 committed Mar 22, 2018
2 parents 80298cb + 52ec2f2 commit c7d2666
Show file tree
Hide file tree
Showing 28 changed files with 13,998 additions and 1,069 deletions.
36 changes: 36 additions & 0 deletions Conf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ enum SECTION {
SECTION_DMRID_LOOKUP,
SECTION_NXDNID_LOOKUP,
SECTION_MODEM,
SECTION_TRANSPARENT,
SECTION_UMP,
SECTION_DSTAR,
SECTION_DMR,
Expand Down Expand Up @@ -104,6 +105,10 @@ m_modemNXDNTXLevel(50.0F),
m_modemRSSIMappingFile(),
m_modemTrace(false),
m_modemDebug(false),
m_transparentEnabled(false),
m_transparentRemoteAddress(),
m_transparentRemotePort(0U),
m_transparentLocalPort(0U),
m_umpEnabled(false),
m_umpPort(),
m_dstarEnabled(false),
Expand Down Expand Up @@ -253,6 +258,8 @@ bool CConf::read()
section = SECTION_NXDNID_LOOKUP;
else if (::strncmp(buffer, "[Modem]", 7U) == 0)
section = SECTION_MODEM;
else if (::strncmp(buffer, "[Transparent Data]", 18U) == 0)
section = SECTION_TRANSPARENT;
else if (::strncmp(buffer, "[UMP]", 5U) == 0)
section = SECTION_UMP;
else if (::strncmp(buffer, "[D-Star]", 8U) == 0)
Expand Down Expand Up @@ -423,6 +430,15 @@ bool CConf::read()
m_modemTrace = ::atoi(value) == 1;
else if (::strcmp(key, "Debug") == 0)
m_modemDebug = ::atoi(value) == 1;
} else if (section == SECTION_TRANSPARENT) {
if (::strcmp(key, "Enable") == 0)
m_transparentEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "RemoteAddress") == 0)
m_transparentRemoteAddress = value;
else if (::strcmp(key, "RemotePort") == 0)
m_transparentRemotePort = (unsigned int)::atoi(value);
else if (::strcmp(key, "LocalPort") == 0)
m_transparentLocalPort = (unsigned int)::atoi(value);
} else if (section == SECTION_UMP) {
if (::strcmp(key, "Enable") == 0)
m_umpEnabled = ::atoi(value) == 1;
Expand Down Expand Up @@ -956,6 +972,26 @@ bool CConf::getModemDebug() const
return m_modemDebug;
}

bool CConf::getTransparentEnabled() const
{
return m_transparentEnabled;
}

std::string CConf::getTransparentRemoteAddress() const
{
return m_transparentRemoteAddress;
}

unsigned int CConf::getTransparentRemotePort() const
{
return m_transparentRemotePort;
}

unsigned int CConf::getTransparentLocalPort() const
{
return m_transparentLocalPort;
}

bool CConf::getUMPEnabled() const
{
return m_umpEnabled;
Expand Down
11 changes: 11 additions & 0 deletions Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class CConf
bool getModemTrace() const;
bool getModemDebug() const;

// The Transparent Data section
bool getTransparentEnabled() const;
std::string getTransparentRemoteAddress() const;
unsigned int getTransparentRemotePort() const;
unsigned int getTransparentLocalPort() const;

// The UMP section
bool getUMPEnabled() const;
std::string getUMPPort() const;
Expand Down Expand Up @@ -292,6 +298,11 @@ class CConf
bool m_modemTrace;
bool m_modemDebug;

bool m_transparentEnabled;
std::string m_transparentRemoteAddress;
unsigned int m_transparentRemotePort;
unsigned int m_transparentLocalPort;

bool m_umpEnabled;
std::string m_umpPort;

Expand Down
Loading

0 comments on commit c7d2666

Please sign in to comment.