From 020a08168dfa556a91cc9afc37013e3c4b7e37c1 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 22 Sep 2016 22:07:35 +0100 Subject: [PATCH] Change the tag to be just the callsign. --- YSFGateway/Network.cpp | 12 ++---------- YSFGateway/Network.h | 4 ++-- YSFGateway/WiresX.cpp | 7 ++++--- YSFGateway/YSFGateway.cpp | 4 ++-- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/YSFGateway/Network.cpp b/YSFGateway/Network.cpp index 117fad2..3913d6f 100644 --- a/YSFGateway/Network.cpp +++ b/YSFGateway/Network.cpp @@ -27,7 +27,7 @@ const unsigned int BUFFER_LENGTH = 200U; -CNetwork::CNetwork(const std::string& address, unsigned int port, const std::string& callsign, const std::string& suffix, bool debug) : +CNetwork::CNetwork(const std::string& address, unsigned int port, const std::string& callsign, bool debug) : m_socket(address, port), m_debug(debug), m_address(), @@ -42,17 +42,13 @@ m_timer(1000U, 5U) ::memcpy(m_poll + 0U, "YSFP", 4U); std::string node = callsign; - if (suffix.size() > 0U) { - node.append("-"); - node.append(suffix); - } node.resize(YSF_CALLSIGN_LENGTH, ' '); for (unsigned int i = 0U; i < YSF_CALLSIGN_LENGTH; i++) m_poll[i + 4U] = node.at(i); } -CNetwork::CNetwork(unsigned int port, const std::string& callsign, const std::string& suffix, bool debug) : +CNetwork::CNetwork(unsigned int port, const std::string& callsign, bool debug) : m_socket(port), m_debug(debug), m_address(), @@ -67,10 +63,6 @@ m_timer(1000U, 5U) ::memcpy(m_poll + 0U, "YSFP", 4U); std::string node = callsign; - if (suffix.size() > 0U) { - node.append("-"); - node.append(suffix); - } node.resize(YSF_CALLSIGN_LENGTH, ' '); for (unsigned int i = 0U; i < YSF_CALLSIGN_LENGTH; i++) diff --git a/YSFGateway/Network.h b/YSFGateway/Network.h index e9045f7..fc3fd96 100644 --- a/YSFGateway/Network.h +++ b/YSFGateway/Network.h @@ -29,8 +29,8 @@ class CNetwork { public: - CNetwork(const std::string& address, unsigned int port, const std::string& callsign, const std::string& suffix, bool debug); - CNetwork(unsigned int port, const std::string& callsign, const std::string& suffix, bool debug); + CNetwork(const std::string& address, unsigned int port, const std::string& callsign, bool debug); + CNetwork(unsigned int port, const std::string& callsign, bool debug); ~CNetwork(); bool open(); diff --git a/YSFGateway/WiresX.cpp b/YSFGateway/WiresX.cpp index 70c50d8..14c2944 100644 --- a/YSFGateway/WiresX.cpp +++ b/YSFGateway/WiresX.cpp @@ -141,10 +141,11 @@ void CWiresX::setInfo(const std::string& name, unsigned int txFrequency, unsigne for (unsigned int i = 0U; i < 34U; i++) m_header[i] = NET_HEADER[i]; - for (unsigned int i = 0U; i < 10U; i++) { - m_header[i + 4U] = m_node.at(i); + for (unsigned int i = 0U; i < 10U; i++) + m_header[i + 4U] = m_callsign.at(i); + + for (unsigned int i = 0U; i < 10U; i++) m_header[i + 14U] = m_node.at(i); - } } bool CWiresX::start() diff --git a/YSFGateway/YSFGateway.cpp b/YSFGateway/YSFGateway.cpp index 0a84a56..ec4af2d 100644 --- a/YSFGateway/YSFGateway.cpp +++ b/YSFGateway/YSFGateway.cpp @@ -174,7 +174,7 @@ int CYSFGateway::run() std::string myAddress = m_conf.getMyAddress(); unsigned int myPort = m_conf.getMyPort(); - CNetwork rptNetwork(myAddress, myPort, m_callsign, m_suffix, debug); + CNetwork rptNetwork(myAddress, myPort, m_callsign, debug); rptNetwork.setDestination(rptAddress, rptPort); ret = rptNetwork.open(); @@ -185,7 +185,7 @@ int CYSFGateway::run() unsigned int netPort = m_conf.getNetworkDataPort(); - m_netNetwork = new CNetwork(netPort, m_callsign, m_suffix, debug); + m_netNetwork = new CNetwork(netPort, m_callsign, debug); ret = m_netNetwork->open(); if (!ret) { ::LogError("Cannot open the reflector network port");