Add option for default Dst TG in DMR2YSF

This commit is contained in:
Andy CA6JAU 2018-07-24 01:07:18 -04:00
parent fbe30c930c
commit dd4be1354e
4 changed files with 12 additions and 0 deletions

View File

@ -48,6 +48,7 @@ m_dmrRptAddress(),
m_dmrRptPort(0U),
m_dmrLocalAddress(),
m_dmrLocalPort(0U),
m_dmrDefaultDstTG(9U),
m_dmrDebug(false),
m_dmrIdLookupFile(),
m_dmrIdLookupTime(0U),
@ -134,6 +135,8 @@ bool CConf::read()
m_dmrLocalAddress = value;
else if (::strcmp(key, "LocalPort") == 0)
m_dmrLocalPort = (unsigned int)::atoi(value);
else if (::strcmp(key, "DefaultDstTG") == 0)
m_dmrDefaultDstTG = (unsigned int)::atoi(value);
else if (::strcmp(key, "Debug") == 0)
m_dmrDebug = ::atoi(value) == 1;
} else if (section == SECTION_DMRID_LOOKUP) {
@ -213,6 +216,11 @@ unsigned int CConf::getDMRLocalPort() const
return m_dmrLocalPort;
}
unsigned int CConf::getDMRDefaultDstTG() const
{
return m_dmrDefaultDstTG;
}
bool CConf::getDMRDebug() const
{
return m_dmrDebug;

View File

@ -45,6 +45,7 @@ public:
unsigned int getDMRRptPort() const;
std::string getDMRLocalAddress() const;
unsigned int getDMRLocalPort() const;
unsigned int getDMRDefaultDstTG() const;
bool getDMRDebug() const;
// The DMR Id section
@ -71,6 +72,7 @@ private:
unsigned int m_dmrRptPort;
std::string m_dmrLocalAddress;
unsigned int m_dmrLocalPort;
unsigned int m_dmrDefaultDstTG;
bool m_dmrDebug;
std::string m_dmrIdLookupFile;

View File

@ -203,6 +203,7 @@ int CDMR2YSF::run()
m_callsign = m_conf.getCallsign();
m_defsrcid = m_conf.getDMRId();
m_dstid = m_conf.getDMRDefaultDstTG();
in_addr dstAddress = CUDPSocket::lookup(m_conf.getDstAddress());
unsigned int dstPort = m_conf.getDstPort();

View File

@ -12,6 +12,7 @@ RptAddress=127.0.0.1
RptPort=62032
LocalAddress=127.0.0.1
LocalPort=62031
DefaultDstTG=9
Debug=0
[DMR Id Lookup]