mirror of
https://github.com/g4klx/DMRGateway
synced 2025-12-20 21:25:37 +08:00
Add config option to enable/disable user XLX link control
This commit is contained in:
9
Conf.cpp
9
Conf.cpp
@@ -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
2
Conf.h
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user