Add config option to enable/disable user XLX link control

This commit is contained in:
Simon
2018-10-21 10:18:55 +01:00
parent 4ed864a34e
commit 3ce8076e89
4 changed files with 26 additions and 8 deletions

View File

@@ -126,7 +126,8 @@ m_xlxNetworkTG(8U),
m_xlxNetworkBase(84000U),
m_xlxNetworkStartup(4000U),
m_xlxNetworkRelink(0U),
m_xlxNetworkDebug(false)
m_xlxNetworkDebug(false),
m_xlxNetworkUserControl(true)
{
}
@@ -272,6 +273,8 @@ bool CConf::read()
m_xlxNetworkRelink = (unsigned int)::atoi(value);
else if (::strcmp(key, "Debug") == 0)
m_xlxNetworkDebug = ::atoi(value) == 1;
else if (::strcmp(key, "UserControl") == 0)
m_xlxNetworkUserControl = atoi(value) ==1;
} else if (section == SECTION_DMR_NETWORK_1) {
if (::strcmp(key, "Enabled") == 0)
m_dmrNetwork1Enabled = ::atoi(value) == 1;
@@ -732,6 +735,10 @@ bool CConf::getXLXNetworkDebug() const
{
return m_xlxNetworkDebug;
}
bool CConf::getXLXNetworkUserControl() const
{
return m_xlxNetworkUserControl;
}
bool CConf::getDMRNetwork1Enabled() const
{

2
Conf.h
View File

@@ -163,6 +163,7 @@ public:
unsigned int getXLXNetworkStartup() const;
unsigned int getXLXNetworkRelink() const;
bool getXLXNetworkDebug() const;
bool getXLXNetworkUserControl() const;
private:
std::string m_file;
@@ -260,6 +261,7 @@ private:
unsigned int m_xlxNetworkStartup;
unsigned int m_xlxNetworkRelink;
bool m_xlxNetworkDebug;
bool m_xlxNetworkUserControl;
};
#endif

View File

@@ -156,6 +156,7 @@ m_xlxRoom(4000U),
m_xlxRelink(1000U),
m_xlxConnected(false),
m_xlxDebug(false),
m_xlxUserControl(true),
m_rptRewrite(NULL),
m_xlxRewrite(NULL),
m_dmr1NetRewrites(),
@@ -483,7 +484,7 @@ int CDMRGateway::run()
status[slotNo] = DMRGWS_XLXREFLECTOR;
timer[slotNo]->setTimeout(rfTimeout);
timer[slotNo]->start();
} else if ((dstId <= (m_xlxBase + 26U) || dstId == (m_xlxBase + 1000U)) && flco == FLCO_USER_USER && slotNo == m_xlxSlot && dstId >= m_xlxBase) {
} else if ((dstId <= (m_xlxBase + 26U) || dstId == (m_xlxBase + 1000U)) && flco == FLCO_USER_USER && slotNo == m_xlxSlot && dstId >= m_xlxBase && m_xlxUserControl) {
dstId += 4000U;
dstId -= m_xlxBase;
@@ -525,7 +526,7 @@ int CDMRGateway::run()
}
}
}
} else if (dstId >= (m_xlxBase + 4000U) && dstId < (m_xlxBase + 5000U) && flco == FLCO_USER_USER && slotNo == m_xlxSlot) {
} else if (dstId >= (m_xlxBase + 4000U) && dstId < (m_xlxBase + 5000U) && flco == FLCO_USER_USER && slotNo == m_xlxSlot && m_xlxUserControl) {
dstId -= 4000U;
dstId -= m_xlxBase;
@@ -1370,11 +1371,12 @@ bool CDMRGateway::createXLXNetwork()
return false;
}
m_xlxLocal = m_conf.getXLXNetworkLocal();
m_xlxPort = m_conf.getXLXNetworkPort();
m_xlxPassword = m_conf.getXLXNetworkPassword();
m_xlxId = m_conf.getXLXNetworkId();
m_xlxDebug = m_conf.getXLXNetworkDebug();
m_xlxLocal = m_conf.getXLXNetworkLocal();
m_xlxPort = m_conf.getXLXNetworkPort();
m_xlxPassword = m_conf.getXLXNetworkPassword();
m_xlxId = m_conf.getXLXNetworkId();
m_xlxDebug = m_conf.getXLXNetworkDebug();
m_xlxUserControl = m_conf.getXLXNetworkUserControl();
if (m_xlxId == 0U)
m_xlxId = m_repeater->getId();
@@ -1406,6 +1408,12 @@ bool CDMRGateway::createXLXNetwork()
} else {
LogInfo(" Relink: disabled");
}
if (m_xlxUserControl) {
LogInfo(" User Control: enabled");
} else {
LogInfo(" User Control: disabled");
}
if (m_xlxStartup > 0U)
linkXLX(m_xlxStartup);

View File

@@ -65,6 +65,7 @@ private:
CTimer m_xlxRelink;
bool m_xlxConnected;
bool m_xlxDebug;
bool m_xlxUserControl;
CRewriteTG* m_rptRewrite;
CRewriteTG* m_xlxRewrite;
std::vector<CRewrite*> m_dmr1NetRewrites;