Move the Id into the General section.

This commit is contained in:
Jonathan Naylor
2017-08-19 16:23:37 +01:00
parent afe38bcb9d
commit fda4049928
5 changed files with 28 additions and 4 deletions

View File

@@ -55,6 +55,7 @@ enum SECTION {
CConf::CConf(const std::string& file) : CConf::CConf(const std::string& file) :
m_file(file), m_file(file),
m_callsign(), m_callsign(),
m_id(0U),
m_timeout(120U), m_timeout(120U),
m_duplex(true), m_duplex(true),
m_rfModeHang(10U), m_rfModeHang(10U),
@@ -126,6 +127,7 @@ m_fusionSelfOnly(false),
m_fusionSQLEnabled(false), m_fusionSQLEnabled(false),
m_fusionSQL(0U), m_fusionSQL(0U),
m_p25Enabled(false), m_p25Enabled(false),
m_p25Id(0U),
m_p25NAC(0x293U), m_p25NAC(0x293U),
m_p25SelfOnly(false), m_p25SelfOnly(false),
m_dstarNetworkEnabled(false), m_dstarNetworkEnabled(false),
@@ -264,7 +266,9 @@ bool CConf::read()
for (unsigned int i = 0U; value[i] != 0; i++) for (unsigned int i = 0U; value[i] != 0; i++)
value[i] = ::toupper(value[i]); value[i] = ::toupper(value[i]);
m_cwIdCallsign = m_callsign = value; m_cwIdCallsign = m_callsign = value;
} else if (::strcmp(key, "Timeout") == 0) } else if (::strcmp(key, "Id") == 0)
m_id = m_p25Id = m_dmrId = (unsigned int)::atoi(value);
else if (::strcmp(key, "Timeout") == 0)
m_timeout = (unsigned int)::atoi(value); m_timeout = (unsigned int)::atoi(value);
else if (::strcmp(key, "Duplex") == 0) else if (::strcmp(key, "Duplex") == 0)
m_duplex = ::atoi(value) == 1; m_duplex = ::atoi(value) == 1;
@@ -466,6 +470,8 @@ bool CConf::read()
} else if (section == SECTION_P25) { } else if (section == SECTION_P25) {
if (::strcmp(key, "Enable") == 0) if (::strcmp(key, "Enable") == 0)
m_p25Enabled = ::atoi(value) == 1; m_p25Enabled = ::atoi(value) == 1;
else if (::strcmp(key, "Id") == 0)
m_p25Id = (unsigned int)::atoi(value);
else if (::strcmp(key, "NAC") == 0) else if (::strcmp(key, "NAC") == 0)
m_p25NAC = (unsigned int)::strtoul(value, NULL, 16); m_p25NAC = (unsigned int)::strtoul(value, NULL, 16);
else if (::strcmp(key, "OverrideUIDCheck") == 0) else if (::strcmp(key, "OverrideUIDCheck") == 0)
@@ -606,6 +612,11 @@ std::string CConf::getCallsign() const
return m_callsign; return m_callsign;
} }
unsigned int CConf::getId() const
{
return m_id;
}
unsigned int CConf::getTimeout() const unsigned int CConf::getTimeout() const
{ {
return m_timeout; return m_timeout;
@@ -961,6 +972,11 @@ bool CConf::getP25Enabled() const
return m_p25Enabled; return m_p25Enabled;
} }
unsigned int CConf::getP25Id() const
{
return m_p25Id;
}
unsigned int CConf::getP25NAC() const unsigned int CConf::getP25NAC() const
{ {
return m_p25NAC; return m_p25NAC;

4
Conf.h
View File

@@ -32,6 +32,7 @@ public:
// The General section // The General section
std::string getCallsign() const; std::string getCallsign() const;
unsigned int getId() const;
unsigned int getTimeout() const; unsigned int getTimeout() const;
bool getDuplex() const; bool getDuplex() const;
unsigned int getRFModeHang() const; unsigned int getRFModeHang() const;
@@ -123,6 +124,7 @@ public:
// The P25 section // The P25 section
bool getP25Enabled() const; bool getP25Enabled() const;
unsigned int getP25Id() const;
unsigned int getP25NAC() const; unsigned int getP25NAC() const;
bool getP25SelfOnly() const; bool getP25SelfOnly() const;
@@ -200,6 +202,7 @@ public:
private: private:
std::string m_file; std::string m_file;
unsigned int m_id;
std::string m_callsign; std::string m_callsign;
unsigned int m_timeout; unsigned int m_timeout;
bool m_duplex; bool m_duplex;
@@ -282,6 +285,7 @@ private:
unsigned char m_fusionSQL; unsigned char m_fusionSQL;
bool m_p25Enabled; bool m_p25Enabled;
unsigned int m_p25Id;
unsigned int m_p25NAC; unsigned int m_p25NAC;
bool m_p25SelfOnly; bool m_p25SelfOnly;

View File

@@ -1,5 +1,6 @@
[General] [General]
Callsign=G9BF Callsign=G9BF
Id=123456
Timeout=180 Timeout=180
Duplex=1 Duplex=1
# ModeHang=10 # ModeHang=10
@@ -72,7 +73,6 @@ ErrorReply=1
[DMR] [DMR]
Enable=1 Enable=1
Beacons=1 Beacons=1
Id=123456
ColorCode=1 ColorCode=1
SelfOnly=0 SelfOnly=0
EmbeddedLCOnly=0 EmbeddedLCOnly=0

View File

@@ -149,6 +149,7 @@ m_p25Enabled(false),
m_cwIdTime(0U), m_cwIdTime(0U),
m_lookup(NULL), m_lookup(NULL),
m_callsign(), m_callsign(),
m_id(0U),
m_cwCallsign() m_cwCallsign()
{ {
} }
@@ -426,14 +427,14 @@ int CMMDVMHost::run()
CP25Control* p25 = NULL; CP25Control* p25 = NULL;
if (m_p25Enabled) { if (m_p25Enabled) {
unsigned int id = m_conf.getP25Id();
unsigned int nac = m_conf.getP25NAC(); unsigned int nac = m_conf.getP25NAC();
unsigned int id = m_conf.getDMRId();
bool uidOverride = m_conf.getP25OverrideUID(); bool uidOverride = m_conf.getP25OverrideUID();
bool selfOnly = m_conf.getP25SelfOnly(); bool selfOnly = m_conf.getP25SelfOnly();
LogInfo("P25 Parameters"); LogInfo("P25 Parameters");
LogInfo(" NAC: $%03X", nac);
LogInfo(" Id: %u", id); LogInfo(" Id: %u", id);
LogInfo(" NAC: $%03X", nac);
LogInfo(" UID Override: %s", uidOverride ? "yes" : "no"); LogInfo(" UID Override: %s", uidOverride ? "yes" : "no");
LogInfo(" Self Only: %s", selfOnly ? "yes" : "no"); LogInfo(" Self Only: %s", selfOnly ? "yes" : "no");
@@ -1024,6 +1025,7 @@ void CMMDVMHost::readParams()
m_p25Enabled = m_conf.getP25Enabled(); m_p25Enabled = m_conf.getP25Enabled();
m_duplex = m_conf.getDuplex(); m_duplex = m_conf.getDuplex();
m_callsign = m_conf.getCallsign(); m_callsign = m_conf.getCallsign();
m_id = m_conf.getId();
m_timeout = m_conf.getTimeout(); m_timeout = m_conf.getTimeout();
m_rfModeHang = m_conf.getRFModeHang(); m_rfModeHang = m_conf.getRFModeHang();
@@ -1031,6 +1033,7 @@ void CMMDVMHost::readParams()
LogInfo("General Parameters"); LogInfo("General Parameters");
LogInfo(" Callsign: %s", m_callsign.c_str()); LogInfo(" Callsign: %s", m_callsign.c_str());
LogInfo(" Id: %u", m_id);
LogInfo(" Duplex: %s", m_duplex ? "yes" : "no"); LogInfo(" Duplex: %s", m_duplex ? "yes" : "no");
LogInfo(" Timeout: %us", m_timeout); LogInfo(" Timeout: %us", m_timeout);
LogInfo(" RF Mode Hang: %us", m_rfModeHang); LogInfo(" RF Mode Hang: %us", m_rfModeHang);

View File

@@ -64,6 +64,7 @@ private:
unsigned int m_cwIdTime; unsigned int m_cwIdTime;
CDMRLookup* m_lookup; CDMRLookup* m_lookup;
std::string m_callsign; std::string m_callsign;
unsigned int m_id;
std::string m_cwCallsign; std::string m_cwCallsign;
void readParams(); void readParams();