mirror of
https://github.com/ShaYmez/MMDVM_CM.git
synced 2025-09-02 05:07:47 -04:00
Add default ID for DMR2NXDN and NXDN2DMR
This commit is contained in:
parent
1a1a5f991e
commit
8dc36e0e8c
@ -43,6 +43,7 @@ m_dstAddress(),
|
||||
m_dstPort(0U),
|
||||
m_localAddress(),
|
||||
m_localPort(0U),
|
||||
m_defaultID(65519U),
|
||||
m_daemon(false),
|
||||
m_dmrId(0U),
|
||||
m_dmrRptAddress(),
|
||||
@ -126,6 +127,8 @@ bool CConf::read()
|
||||
m_localAddress = value;
|
||||
else if (::strcmp(key, "LocalPort") == 0)
|
||||
m_localPort = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "DefaultID") == 0)
|
||||
m_defaultID = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "Daemon") == 0)
|
||||
m_daemon = ::atoi(value) == 1;
|
||||
} else if (section == SECTION_DMR_NETWORK) {
|
||||
@ -193,6 +196,11 @@ unsigned int CConf::getLocalPort() const
|
||||
return m_localPort;
|
||||
}
|
||||
|
||||
unsigned int CConf::getDefaultID() const
|
||||
{
|
||||
return m_defaultID;
|
||||
}
|
||||
|
||||
bool CConf::getDaemon() const
|
||||
{
|
||||
return m_daemon;
|
||||
|
@ -31,12 +31,13 @@ public:
|
||||
|
||||
bool read();
|
||||
|
||||
// The YSF Network section
|
||||
// The NXDN Network section
|
||||
std::string getCallsign() const;
|
||||
std::string getDstAddress() const;
|
||||
unsigned int getDstPort() const;
|
||||
std::string getLocalAddress() const;
|
||||
unsigned int getLocalPort() const;
|
||||
unsigned int getDefaultID() const;
|
||||
bool getDaemon() const;
|
||||
|
||||
// The DMR Network section
|
||||
@ -68,6 +69,7 @@ private:
|
||||
unsigned int m_dstPort;
|
||||
std::string m_localAddress;
|
||||
unsigned int m_localPort;
|
||||
unsigned int m_defaultID;
|
||||
bool m_daemon;
|
||||
|
||||
unsigned int m_dmrId;
|
||||
|
@ -121,7 +121,8 @@ m_dmrflco(FLCO_GROUP),
|
||||
m_dmrinfo(false),
|
||||
m_nxdninfo(false),
|
||||
m_config(NULL),
|
||||
m_configLen(0U)
|
||||
m_configLen(0U),
|
||||
m_defaultID(65519U)
|
||||
{
|
||||
m_nxdnFrame = new unsigned char[200U];
|
||||
m_dmrFrame = new unsigned char[50U];
|
||||
@ -235,6 +236,8 @@ int CDMR2NXDN::run()
|
||||
std::string localAddress = m_conf.getLocalAddress();
|
||||
unsigned int localPort = m_conf.getLocalPort();
|
||||
|
||||
m_defaultID = m_conf.getDefaultID();
|
||||
|
||||
m_nxdnNetwork = new CNXDNNetwork(localAddress, localPort, gatewayAddress, gatewayPort, false);
|
||||
m_nxdnNetwork->enable(true);
|
||||
|
||||
@ -755,11 +758,8 @@ unsigned int CDMR2NXDN::truncID(unsigned int id)
|
||||
snprintf(temp, 8, "%07d", id);
|
||||
unsigned int newid = atoi(temp + 2);
|
||||
|
||||
if (newid > 65519)
|
||||
newid = 65519;
|
||||
|
||||
if (newid == 0)
|
||||
newid = 1;
|
||||
if (newid > 65519 || newid == 0)
|
||||
newid = m_defaultID;
|
||||
|
||||
return newid;
|
||||
}
|
||||
|
@ -83,6 +83,7 @@ private:
|
||||
bool m_nxdninfo;
|
||||
unsigned char* m_config;
|
||||
unsigned int m_configLen;
|
||||
unsigned int m_defaultID;
|
||||
|
||||
unsigned int findNXDNID(unsigned int dmrid);
|
||||
unsigned int findDMRID(unsigned int nxdnid);
|
||||
|
@ -3,6 +3,7 @@ GatewayAddress=127.0.0.1
|
||||
GatewayPort=14020
|
||||
LocalAddress=127.0.0.1
|
||||
LocalPort=14021
|
||||
DefaultID=65519
|
||||
Daemon=0
|
||||
|
||||
[DMR Network]
|
||||
|
@ -20,6 +20,6 @@
|
||||
#if !defined(VERSION_H)
|
||||
#define VERSION_H
|
||||
|
||||
const char* VERSION = "20180805";
|
||||
const char* VERSION = "20180809";
|
||||
|
||||
#endif
|
||||
|
@ -45,6 +45,7 @@ m_dstAddress(),
|
||||
m_dstPort(0U),
|
||||
m_localAddress(),
|
||||
m_localPort(0U),
|
||||
m_defaultID(65519U),
|
||||
m_daemon(false),
|
||||
m_rxFrequency(0U),
|
||||
m_txFrequency(0U),
|
||||
@ -150,6 +151,8 @@ bool CConf::read()
|
||||
m_localAddress = value;
|
||||
else if (::strcmp(key, "LocalPort") == 0)
|
||||
m_localPort = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "DefaultID") == 0)
|
||||
m_defaultID = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "Daemon") == 0)
|
||||
m_daemon = ::atoi(value) == 1;
|
||||
} else if (section == SECTION_INFO) {
|
||||
@ -260,6 +263,11 @@ unsigned int CConf::getLocalPort() const
|
||||
return m_localPort;
|
||||
}
|
||||
|
||||
unsigned int CConf::getDefaultID() const
|
||||
{
|
||||
return m_defaultID;
|
||||
}
|
||||
|
||||
bool CConf::getDaemon() const
|
||||
{
|
||||
return m_daemon;
|
||||
|
@ -38,6 +38,7 @@ public:
|
||||
unsigned int getDstPort() const;
|
||||
std::string getLocalAddress() const;
|
||||
unsigned int getLocalPort() const;
|
||||
unsigned int getDefaultID() const;
|
||||
bool getDaemon() const;
|
||||
|
||||
// The Info section
|
||||
@ -89,6 +90,7 @@ private:
|
||||
unsigned int m_dstPort;
|
||||
std::string m_localAddress;
|
||||
unsigned int m_localPort;
|
||||
unsigned int m_defaultID;
|
||||
bool m_daemon;
|
||||
|
||||
unsigned int m_rxFrequency;
|
||||
|
@ -131,7 +131,8 @@ m_nxdninfo(false),
|
||||
m_xlxmodule(),
|
||||
m_xlxConnected(false),
|
||||
m_xlxReflectors(NULL),
|
||||
m_xlxrefl(0U)
|
||||
m_xlxrefl(0U),
|
||||
m_defaultID(65519U)
|
||||
{
|
||||
m_nxdnFrame = new unsigned char[200U];
|
||||
m_dmrFrame = new unsigned char[50U];
|
||||
@ -245,6 +246,8 @@ int CNXDN2DMR::run()
|
||||
std::string localAddress = m_conf.getLocalAddress();
|
||||
unsigned int localPort = m_conf.getLocalPort();
|
||||
|
||||
m_defaultID = m_conf.getDefaultID();
|
||||
|
||||
std::string fileName = m_conf.getDMRXLXFile();
|
||||
m_xlxReflectors = new CReflectors(fileName, 60U);
|
||||
m_xlxReflectors->load();
|
||||
@ -786,11 +789,8 @@ unsigned int CNXDN2DMR::truncID(unsigned int id)
|
||||
snprintf(temp, 8, "%07d", id);
|
||||
unsigned int newid = atoi(temp + 2);
|
||||
|
||||
if (newid > 65519)
|
||||
newid = 65519;
|
||||
|
||||
if (newid == 0)
|
||||
newid = 1;
|
||||
if (newid > 65519 || newid == 0)
|
||||
newid = m_defaultID;
|
||||
|
||||
return newid;
|
||||
}
|
||||
|
@ -96,6 +96,7 @@ private:
|
||||
bool m_xlxConnected;
|
||||
CReflectors* m_xlxReflectors;
|
||||
unsigned int m_xlxrefl;
|
||||
unsigned int m_defaultID;
|
||||
|
||||
bool createDMRNetwork();
|
||||
unsigned int findNXDNID(unsigned int dmrid);
|
||||
|
@ -16,6 +16,7 @@ DstAddress=127.0.0.1
|
||||
DstPort=14050
|
||||
LocalAddress=127.0.0.1
|
||||
LocalPort=42022
|
||||
DefaultID=65519
|
||||
Daemon=0
|
||||
|
||||
[DMR Network]
|
||||
|
@ -20,6 +20,6 @@
|
||||
#if !defined(VERSION_H)
|
||||
#define VERSION_H
|
||||
|
||||
const char* VERSION = "20180805";
|
||||
const char* VERSION = "20180809";
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user