Add an XLX base so the control ids can be shifted.

This commit is contained in:
Jonathan Naylor
2017-05-25 18:24:05 +01:00
parent d12ac3ecb4
commit 87e261e99e
5 changed files with 19 additions and 1 deletions

View File

@@ -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;

2
Conf.h
View File

@@ -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;
};

View File

@@ -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);

View File

@@ -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<IRewrite*> m_dmr1NetRewrites;

View File

@@ -27,6 +27,7 @@ Port=62030
# Options=
Slot=1
TG=8
Base=4000
Password=passw0rd
Debug=0