diff --git a/YSFGateway/Conf.cpp b/YSFGateway/Conf.cpp index 47b8db0..c3ae505 100644 --- a/YSFGateway/Conf.cpp +++ b/YSFGateway/Conf.cpp @@ -76,6 +76,10 @@ m_ysfNetworkParrotAddress("127.0.0.1"), m_ysfNetworkParrotPort(0U), m_ysfNetworkYSF2DMRAddress("127.0.0.1"), m_ysfNetworkYSF2DMRPort(0U), +m_ysfNetworkYSF2NXDNAddress("127.0.0.1"), +m_ysfNetworkYSF2NXDNPort(0U), +m_ysfNetworkYSF2P25Address("127.0.0.1"), +m_ysfNetworkYSF2P25Port(0U), m_fcsNetworkEnabled(false), m_fcsNetworkEntries(), m_fcsNetworkPort(0U) @@ -213,6 +217,14 @@ bool CConf::read() m_ysfNetworkYSF2DMRAddress = value; else if (::strcmp(key, "YSF2DMRPort") == 0) m_ysfNetworkYSF2DMRPort = (unsigned int)::atoi(value); + else if (::strcmp(key, "YSF2NXDNAddress") == 0) + m_ysfNetworkYSF2NXDNAddress = value; + else if (::strcmp(key, "YSF2NXDNPort") == 0) + m_ysfNetworkYSF2NXDNPort = (unsigned int)::atoi(value); + else if (::strcmp(key, "YSF2P25Address") == 0) + m_ysfNetworkYSF2P25Address = value; + else if (::strcmp(key, "YSF2P25Port") == 0) + m_ysfNetworkYSF2P25Port = (unsigned int)::atoi(value); } else if (section == SECTION_FCS_NETWORK) { if (::strcmp(key, "Enable") == 0) m_fcsNetworkEnabled = ::atoi(value) == 1; @@ -423,6 +435,26 @@ unsigned int CConf::getYSFNetworkYSF2DMRPort() const return m_ysfNetworkYSF2DMRPort; } +std::string CConf::getYSFNetworkYSF2NXDNAddress() const +{ + return m_ysfNetworkYSF2NXDNAddress; +} + +unsigned int CConf::getYSFNetworkYSF2NXDNPort() const +{ + return m_ysfNetworkYSF2NXDNPort; +} + +std::string CConf::getYSFNetworkYSF2P25Address() const +{ + return m_ysfNetworkYSF2P25Address; +} + +unsigned int CConf::getYSFNetworkYSF2P25Port() const +{ + return m_ysfNetworkYSF2P25Port; +} + bool CConf::getFCSNetworkEnabled() const { return m_fcsNetworkEnabled; diff --git a/YSFGateway/Conf.h b/YSFGateway/Conf.h index d7af6e3..3305451 100644 --- a/YSFGateway/Conf.h +++ b/YSFGateway/Conf.h @@ -78,6 +78,10 @@ public: unsigned int getYSFNetworkParrotPort() const; std::string getYSFNetworkYSF2DMRAddress() const; unsigned int getYSFNetworkYSF2DMRPort() const; + std::string getYSFNetworkYSF2NXDNAddress() const; + unsigned int getYSFNetworkYSF2NXDNPort() const; + std::string getYSFNetworkYSF2P25Address() const; + unsigned int getYSFNetworkYSF2P25Port() const; // The FCS Network section bool getFCSNetworkEnabled() const; @@ -128,6 +132,10 @@ private: unsigned int m_ysfNetworkParrotPort; std::string m_ysfNetworkYSF2DMRAddress; unsigned int m_ysfNetworkYSF2DMRPort; + std::string m_ysfNetworkYSF2NXDNAddress; + unsigned int m_ysfNetworkYSF2NXDNPort; + std::string m_ysfNetworkYSF2P25Address; + unsigned int m_ysfNetworkYSF2P25Port; bool m_fcsNetworkEnabled; std::vector> m_fcsNetworkEntries; diff --git a/YSFGateway/WiresX.cpp b/YSFGateway/WiresX.cpp index c85a989..a655bee 100644 --- a/YSFGateway/WiresX.cpp +++ b/YSFGateway/WiresX.cpp @@ -157,6 +157,16 @@ void CWiresX::setYSF2DMR(const std::string& address, unsigned int port) m_reflectors.setYSF2DMR(address, port); } +void CWiresX::setYSF2NXDN(const std::string& address, unsigned int port) +{ + m_reflectors.setYSF2NXDN(address, port); +} + +void CWiresX::setYSF2P25(const std::string& address, unsigned int port) +{ + m_reflectors.setYSF2P25(address, port); +} + void CWiresX::addFCSRoom(const std::pair& entry) { m_reflectors.addFCSRoom(entry); diff --git a/YSFGateway/WiresX.h b/YSFGateway/WiresX.h index 5873a3f..9c2aab5 100644 --- a/YSFGateway/WiresX.h +++ b/YSFGateway/WiresX.h @@ -49,6 +49,8 @@ public: void setInfo(const std::string& name, unsigned int txFrequency, unsigned int rxFrequency); void setParrot(const std::string& address, unsigned int port); void setYSF2DMR(const std::string& address, unsigned int port); + void setYSF2NXDN(const std::string& address, unsigned int port); + void setYSF2P25(const std::string& address, unsigned int port); void addFCSRoom(const std::pair& entry); bool start(); diff --git a/YSFGateway/YSFGateway.cpp b/YSFGateway/YSFGateway.cpp index 53735ee..de80204 100644 --- a/YSFGateway/YSFGateway.cpp +++ b/YSFGateway/YSFGateway.cpp @@ -465,6 +465,16 @@ void CYSFGateway::createWiresX(CYSFNetwork* rptNetwork) if (port > 0U) m_wiresX->setYSF2DMR(address, port); + address = m_conf.getYSFNetworkYSF2NXDNAddress(); + port = m_conf.getYSFNetworkYSF2NXDNPort(); + if (port > 0U) + m_wiresX->setYSF2NXDN(address, port); + + address = m_conf.getYSFNetworkYSF2P25Address(); + port = m_conf.getYSFNetworkYSF2P25Port(); + if (port > 0U) + m_wiresX->setYSF2P25(address, port); + std::vector> entries = m_conf.getFCSNetworkEntries(); for (std::vector>::const_iterator it = entries.cbegin(); it != entries.cend(); ++it) m_wiresX->addFCSRoom(*it); diff --git a/YSFGateway/YSFGateway.ini b/YSFGateway/YSFGateway.ini index 310f181..28c6de5 100644 --- a/YSFGateway/YSFGateway.ini +++ b/YSFGateway/YSFGateway.ini @@ -50,6 +50,10 @@ ParrotAddress=127.0.0.1 ParrotPort=42012 YSF2DMRAddress=127.0.0.1 YSF2DMRPort=42013 +YSF2NXDNAddress=127.0.0.1 +YSF2NXDNPort=42014 +YSF2P25Address=127.0.0.1 +YSF2P25Port=42015 [FCS Network] Enable=1 diff --git a/YSFGateway/YSFReflectors.cpp b/YSFGateway/YSFReflectors.cpp index 8cbceba..ee93aa9 100644 --- a/YSFGateway/YSFReflectors.cpp +++ b/YSFGateway/YSFReflectors.cpp @@ -32,6 +32,10 @@ m_parrotAddress(), m_parrotPort(0U), m_YSF2DMRAddress(), m_YSF2DMRPort(0U), +m_YSF2NXDNAddress(), +m_YSF2NXDNPort(0U), +m_YSF2P25Address(), +m_YSF2P25Port(0U), m_fcsRooms(), m_newReflectors(), m_currReflectors(), @@ -83,6 +87,18 @@ void CYSFReflectors::setYSF2DMR(const std::string& address, unsigned int port) m_YSF2DMRPort = port; } +void CYSFReflectors::setYSF2NXDN(const std::string& address, unsigned int port) +{ + m_YSF2NXDNAddress = address; + m_YSF2NXDNPort = port; +} + +void CYSFReflectors::setYSF2P25(const std::string& address, unsigned int port) +{ + m_YSF2P25Address = address; + m_YSF2P25Port = port; +} + void CYSFReflectors::addFCSRoom(const std::pair& entry) { m_fcsRooms.push_back(entry); @@ -169,6 +185,38 @@ bool CYSFReflectors::load() LogInfo("Loaded YSF2DMR"); } + // Add the YSF2NXDN entry + if (m_YSF2NXDNPort > 0U) { + CYSFReflector* refl = new CYSFReflector; + refl->m_id = "00003"; + refl->m_name = "YSF2NXDN "; + refl->m_desc = "Link YSF2NXDN "; + refl->m_address = CUDPSocket::lookup(m_YSF2NXDNAddress); + refl->m_port = m_YSF2NXDNPort; + refl->m_count = "000"; + refl->m_type = YT_YSF; + + m_newReflectors.push_back(refl); + + LogInfo("Loaded YSF2NXDN"); + } + + // Add the YSF2P25 entry + if (m_YSF2P25Port > 0U) { + CYSFReflector* refl = new CYSFReflector; + refl->m_id = "00004"; + refl->m_name = "YSF2P25 "; + refl->m_desc = "Link YSF2P25 "; + refl->m_address = CUDPSocket::lookup(m_YSF2P25Address); + refl->m_port = m_YSF2P25Port; + refl->m_count = "000"; + refl->m_type = YT_YSF; + + m_newReflectors.push_back(refl); + + LogInfo("Loaded YSF2P25"); + } + unsigned int id = 10U; for (std::vector>::const_iterator it = m_fcsRooms.cbegin(); it != m_fcsRooms.cend(); ++it, id++) { char text[10U]; diff --git a/YSFGateway/YSFReflectors.h b/YSFGateway/YSFReflectors.h index e713648..b30e5e7 100644 --- a/YSFGateway/YSFReflectors.h +++ b/YSFGateway/YSFReflectors.h @@ -59,6 +59,8 @@ public: void setParrot(const std::string& address, unsigned int port); void setYSF2DMR(const std::string& address, unsigned int port); + void setYSF2NXDN(const std::string& address, unsigned int port); + void setYSF2P25(const std::string& address, unsigned int port); void addFCSRoom(const std::pair& entry); bool load(); @@ -80,6 +82,10 @@ private: unsigned int m_parrotPort; std::string m_YSF2DMRAddress; unsigned int m_YSF2DMRPort; + std::string m_YSF2NXDNAddress; + unsigned int m_YSF2NXDNPort; + std::string m_YSF2P25Address; + unsigned int m_YSF2P25Port; std::vector> m_fcsRooms; std::vector m_newReflectors; std::vector m_currReflectors;