Merge pull request #108 from juribeparada/master
Support for YSF2NXDN and YSF2P25 pseudo reflectors
This commit is contained in:
commit
1f728403b4
8 changed files with 120 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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<std::pair<std::string, std::string>> m_fcsNetworkEntries;
|
||||
|
|
|
@ -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<std::string, std::string>& entry)
|
||||
{
|
||||
m_reflectors.addFCSRoom(entry);
|
||||
|
|
|
@ -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<std::string, std::string>& entry);
|
||||
|
||||
bool start();
|
||||
|
|
|
@ -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<std::pair<std::string, std::string>> entries = m_conf.getFCSNetworkEntries();
|
||||
for (std::vector<std::pair<std::string, std::string>>::const_iterator it = entries.cbegin(); it != entries.cend(); ++it)
|
||||
m_wiresX->addFCSRoom(*it);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<std::string, std::string>& 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<std::pair<std::string, std::string>>::const_iterator it = m_fcsRooms.cbegin(); it != m_fcsRooms.cend(); ++it, id++) {
|
||||
char text[10U];
|
||||
|
|
|
@ -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<std::string, std::string>& 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<std::pair<std::string, std::string>> m_fcsRooms;
|
||||
std::vector<CYSFReflector*> m_newReflectors;
|
||||
std::vector<CYSFReflector*> m_currReflectors;
|
||||
|
|
Loading…
Reference in a new issue