mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:45:49 +08:00
Align the networking with NXCore.
This commit is contained in:
34
Conf.cpp
34
Conf.cpp
@@ -183,10 +183,7 @@ m_p25LocalPort(0U),
|
||||
m_p25NetworkModeHang(3U),
|
||||
m_p25NetworkDebug(false),
|
||||
m_nxdnNetworkEnabled(false),
|
||||
m_nxdnNetworkMyAddress(),
|
||||
m_nxdnNetworkMyPort(0U),
|
||||
m_nxdnNetworkGatewayAddress(),
|
||||
m_nxdnNetworkGatewayPort(0U),
|
||||
m_nxdnNetworkAddress(),
|
||||
m_nxdnNetworkModeHang(3U),
|
||||
m_nxdnNetworkDebug(false),
|
||||
m_tftSerialPort("/dev/ttyAMA0"),
|
||||
@@ -634,14 +631,8 @@ bool CConf::read()
|
||||
} else if (section == SECTION_NXDN_NETWORK) {
|
||||
if (::strcmp(key, "Enable") == 0)
|
||||
m_nxdnNetworkEnabled = ::atoi(value) == 1;
|
||||
else if (::strcmp(key, "LocalAddress") == 0)
|
||||
m_nxdnNetworkMyAddress = value;
|
||||
else if (::strcmp(key, "LocalPort") == 0)
|
||||
m_nxdnNetworkMyPort = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "GatewayAddress") == 0)
|
||||
m_nxdnNetworkGatewayAddress = value;
|
||||
else if (::strcmp(key, "GatewayPort") == 0)
|
||||
m_nxdnNetworkGatewayPort = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "Address") == 0)
|
||||
m_nxdnNetworkAddress = value;
|
||||
else if (::strcmp(key, "ModeHang") == 0)
|
||||
m_nxdnNetworkModeHang = (unsigned int)::atoi(value);
|
||||
else if (::strcmp(key, "Debug") == 0)
|
||||
@@ -1351,24 +1342,9 @@ bool CConf::getNXDNNetworkEnabled() const
|
||||
return m_nxdnNetworkEnabled;
|
||||
}
|
||||
|
||||
std::string CConf::getNXDNNetworkMyAddress() const
|
||||
std::string CConf::getNXDNNetworkAddress() const
|
||||
{
|
||||
return m_nxdnNetworkMyAddress;
|
||||
}
|
||||
|
||||
unsigned int CConf::getNXDNNetworkMyPort() const
|
||||
{
|
||||
return m_nxdnNetworkMyPort;
|
||||
}
|
||||
|
||||
std::string CConf::getNXDNNetworkGatewayAddress() const
|
||||
{
|
||||
return m_nxdnNetworkGatewayAddress;
|
||||
}
|
||||
|
||||
unsigned int CConf::getNXDNNetworkGatewayPort() const
|
||||
{
|
||||
return m_nxdnNetworkGatewayPort;
|
||||
return m_nxdnNetworkAddress;
|
||||
}
|
||||
|
||||
unsigned int CConf::getNXDNNetworkModeHang() const
|
||||
|
||||
10
Conf.h
10
Conf.h
@@ -191,10 +191,7 @@ public:
|
||||
|
||||
// The NXDN Network section
|
||||
bool getNXDNNetworkEnabled() const;
|
||||
std::string getNXDNNetworkMyAddress() const;
|
||||
unsigned int getNXDNNetworkMyPort() const;
|
||||
std::string getNXDNNetworkGatewayAddress() const;
|
||||
unsigned int getNXDNNetworkGatewayPort() const;
|
||||
std::string getNXDNNetworkAddress() const;
|
||||
unsigned int getNXDNNetworkModeHang() const;
|
||||
bool getNXDNNetworkDebug() const;
|
||||
|
||||
@@ -381,10 +378,7 @@ private:
|
||||
bool m_p25NetworkDebug;
|
||||
|
||||
bool m_nxdnNetworkEnabled;
|
||||
std::string m_nxdnNetworkMyAddress;
|
||||
unsigned int m_nxdnNetworkMyPort;
|
||||
std::string m_nxdnNetworkGatewayAddress;
|
||||
unsigned int m_nxdnNetworkGatewayPort;
|
||||
std::string m_nxdnNetworkAddress;
|
||||
unsigned int m_nxdnNetworkModeHang;
|
||||
bool m_nxdnNetworkDebug;
|
||||
|
||||
|
||||
@@ -160,10 +160,7 @@ Debug=0
|
||||
|
||||
[NXDN Network]
|
||||
Enable=1
|
||||
LocalAddress=127.0.0.1
|
||||
LocalPort=3300
|
||||
GatewayAddress=127.0.0.1
|
||||
GatewayPort=4300
|
||||
Address=127.0.0.1
|
||||
# ModeHang=3
|
||||
Debug=0
|
||||
|
||||
|
||||
@@ -1159,21 +1159,15 @@ bool CMMDVMHost::createP25Network()
|
||||
|
||||
bool CMMDVMHost::createNXDNNetwork()
|
||||
{
|
||||
std::string myAddress = m_conf.getNXDNNetworkMyAddress();
|
||||
unsigned int myPort = m_conf.getNXDNNetworkMyPort();
|
||||
std::string gatewayAddress = m_conf.getNXDNNetworkGatewayAddress();
|
||||
unsigned int gatewayPort = m_conf.getNXDNNetworkGatewayPort();
|
||||
m_nxdnNetModeHang = m_conf.getNXDNNetworkModeHang();
|
||||
bool debug = m_conf.getNXDNNetworkDebug();
|
||||
std::string address = m_conf.getNXDNNetworkAddress();
|
||||
m_nxdnNetModeHang = m_conf.getNXDNNetworkModeHang();
|
||||
bool debug = m_conf.getNXDNNetworkDebug();
|
||||
|
||||
LogInfo("NXDN Network Parameters");
|
||||
LogInfo(" Local Address: %s", myAddress.c_str());
|
||||
LogInfo(" Local Port: %u", myPort);
|
||||
LogInfo(" Gateway Address: %s", gatewayAddress.c_str());
|
||||
LogInfo(" Gateway Port: %u", gatewayPort);
|
||||
LogInfo(" Address: %s", address.c_str());
|
||||
LogInfo(" Mode Hang: %us", m_nxdnNetModeHang);
|
||||
|
||||
m_nxdnNetwork = new CNXDNNetwork(myAddress, myPort, gatewayAddress, gatewayPort, debug);
|
||||
m_nxdnNetwork = new CNXDNNetwork(address, debug);
|
||||
|
||||
bool ret = m_nxdnNetwork->open();
|
||||
if (!ret) {
|
||||
|
||||
Reference in New Issue
Block a user