Add extern dynamic TG control via UDP.

This commit is contained in:
Jonathan Naylor
2020-04-13 14:15:21 +01:00
parent 55af548e6d
commit 42afea8527
8 changed files with 129 additions and 6 deletions

View File

@@ -37,7 +37,8 @@ enum SECTION {
SECTION_DMR_NETWORK_3,
SECTION_DMR_NETWORK_4,
SECTION_DMR_NETWORK_5,
SECTION_XLX_NETWORK
SECTION_XLX_NETWORK,
SECTION_DYNAMIC_TG_CONTROL
};
CConf::CConf(const std::string& file) :
@@ -172,7 +173,9 @@ m_xlxNetworkStartup(4000U),
m_xlxNetworkRelink(0U),
m_xlxNetworkDebug(false),
m_xlxNetworkUserControl(true),
m_xlxNetworkModule()
m_xlxNetworkModule(),
m_dynamicTGControlEnabled(false),
m_dynamicTGControlPort(3769U)
{
}
@@ -216,6 +219,8 @@ bool CConf::read()
section = SECTION_DMR_NETWORK_4;
else if (::strncmp(buffer, "[DMR Network 5]", 15U) == 0)
section = SECTION_DMR_NETWORK_5;
else if (::strncmp(buffer, "[Dynamic TG Control]", 20U) == 0)
section = SECTION_DYNAMIC_TG_CONTROL;
else
section = SECTION_NONE;
@@ -936,6 +941,11 @@ bool CConf::read()
unsigned int slotNo = (unsigned int)::atoi(value);
m_dmrNetwork5PassAllTG.push_back(slotNo);
}
} else if (section == SECTION_DYNAMIC_TG_CONTROL) {
if (::strcmp(key, "Enabled") == 0)
m_dynamicTGControlEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Port") == 0)
m_dynamicTGControlPort = (unsigned int)::atoi(value);
}
}
@@ -1611,3 +1621,13 @@ std::vector<unsigned int> CConf::getDMRNetwork5PassAllTG() const
{
return m_dmrNetwork5PassAllTG;
}
bool CConf::getDynamicTGControlEnabled() const
{
return m_dynamicTGControlEnabled;
}
unsigned int CConf::getDynamicTGControlPort() const
{
return m_dynamicTGControlPort;
}