diff --git a/Conf.cpp b/Conf.cpp index 032fe77..1118ead 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -84,6 +84,7 @@ m_xlxNetworkLocal(0U), m_xlxNetworkPassword(), m_xlxNetworkSlot(2U), m_xlxNetworkTG(9U), +m_xlxNetworkBase(4000U), m_xlxNetworkOptions(), m_xlxNetworkDebug(false) { @@ -183,6 +184,8 @@ bool CConf::read() m_xlxNetworkSlot = (unsigned int)::atoi(value); else if (::strcmp(key, "TG") == 0) m_xlxNetworkTG = (unsigned int)::atoi(value); + else if (::strcmp(key, "Base") == 0) + m_xlxNetworkBase = (unsigned int)::atoi(value); else if (::strcmp(key, "Options") == 0) m_xlxNetworkOptions = value; else if (::strcmp(key, "Debug") == 0) @@ -452,6 +455,11 @@ unsigned int CConf::getXLXNetworkTG() const return m_xlxNetworkTG; } +unsigned int CConf::getXLXNetworkBase() const +{ + return m_xlxNetworkBase; +} + std::string CConf::getXLXNetworkPassword() const { return m_xlxNetworkPassword; diff --git a/Conf.h b/Conf.h index 1019bb4..49c107a 100644 --- a/Conf.h +++ b/Conf.h @@ -118,6 +118,7 @@ public: std::string getXLXNetworkPassword() const; unsigned int getXLXNetworkSlot() const; unsigned int getXLXNetworkTG() const; + unsigned int getXLXNetworkBase() const; std::string getXLXNetworkOptions() const; bool getXLXNetworkDebug() const; @@ -174,6 +175,7 @@ private: std::string m_xlxNetworkPassword; unsigned int m_xlxNetworkSlot; unsigned int m_xlxNetworkTG; + unsigned int m_xlxNetworkBase; std::string m_xlxNetworkOptions; bool m_xlxNetworkDebug; }; diff --git a/DMRGateway.cpp b/DMRGateway.cpp index e6d5aea..44c6284 100644 --- a/DMRGateway.cpp +++ b/DMRGateway.cpp @@ -125,6 +125,7 @@ m_xlxNetwork(NULL), m_reflector(4000U), m_xlxSlot(0U), m_xlxTG(0U), +m_xlxBase(0U), m_rptRewrite(NULL), m_xlxRewrite(NULL), m_dmr1NetRewrites(), @@ -322,7 +323,10 @@ int CDMRGateway::run() m_xlxNetwork->write(data); status[slotNo] = DMRGWS_REFLECTOR; timer[slotNo]->start(); - } else if (flco == FLCO_USER_USER && slotNo == m_xlxSlot && dstId >= 4000U && dstId <= 4026U) { + } else if (flco == FLCO_USER_USER && slotNo == m_xlxSlot && dstId >= m_xlxBase && dstId <= (m_xlxBase + 26U)) { + dstId += 4000U; + dstId -= m_xlxBase; + if (dstId != m_reflector) { if (dstId == 4000U) LogMessage("Unlinking"); @@ -804,9 +808,11 @@ bool CDMRGateway::createXLXNetwork() m_xlxSlot = m_conf.getXLXNetworkSlot(); m_xlxTG = m_conf.getXLXNetworkTG(); + m_xlxBase = m_conf.getXLXNetworkBase(); LogInfo(" Slot: %u", m_xlxSlot); LogInfo(" TG: %u", m_xlxTG); + LogInfo(" Base: %u", m_xlxBase); m_rptRewrite = new CRewriteTG("XLX", XLX_SLOT, XLX_TG, m_xlxSlot, m_xlxTG, 1U); m_xlxRewrite = new CRewriteTG("XLX", m_xlxSlot, m_xlxTG, XLX_SLOT, XLX_TG, 1U); diff --git a/DMRGateway.h b/DMRGateway.h index 52e5eb2..611e174 100644 --- a/DMRGateway.h +++ b/DMRGateway.h @@ -45,6 +45,7 @@ private: unsigned int m_reflector; unsigned int m_xlxSlot; unsigned int m_xlxTG; + unsigned int m_xlxBase; CRewriteTG* m_rptRewrite; CRewriteTG* m_xlxRewrite; std::vector m_dmr1NetRewrites; diff --git a/DMRGateway.ini b/DMRGateway.ini index d10da29..08ff82a 100644 --- a/DMRGateway.ini +++ b/DMRGateway.ini @@ -27,6 +27,7 @@ Port=62030 # Options= Slot=1 TG=8 +Base=4000 Password=passw0rd Debug=0