1
0
Fork 0

Change the tag to be just the callsign.

ycs232-kbc
Jonathan Naylor 8 years ago
parent 935492c5a4
commit 020a08168d

@ -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++)

@ -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();

@ -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()

@ -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");

Loading…
Cancel
Save