1
0
Fork 0

Clean up and remove unused variables

ycs232-kbc
Andy CA6JAU 6 years ago
parent a915b9e863
commit 87510f4e7d

@ -27,7 +27,6 @@
CAPRSWriter::CAPRSWriter(const std::string& callsign, const std::string& rptSuffix, const std::string& password, const std::string& address, unsigned int port, const std::string& suffix) :
m_thread(NULL),
m_enabled(false),
m_idTimer(1000U),
m_callsign(callsign),
m_txFrequency(0U),

@ -59,7 +59,6 @@ public:
private:
CAPRSWriterThread* m_thread;
bool m_enabled;
CTimer m_idTimer;
std::string m_callsign;
unsigned int m_txFrequency;

@ -27,7 +27,6 @@
#include <cassert>
#include <cstring>
const unsigned char NULL_GPS[] = {0x47U, 0x63U};
const unsigned char SHRT_GPS[] = {0x22U, 0x62U};
const unsigned char LONG_GPS[] = {0x47U, 0x64U};

@ -269,23 +269,23 @@ int CYSFGateway::run()
CYSFReflector* reflector = m_wiresX->getReflector();
if (m_ysfNetwork != NULL && m_linkType == LINK_YSF && wiresXCommandPassthrough) {
if (reflector->m_wiresX) {
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, true, wiresXCommandPassthrough);
} else {
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
}
} else if (wiresXCommandPassthrough) {
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
} else {
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
}
if (reflector->m_wiresX) {
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, true, wiresXCommandPassthrough);
} else {
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
}
} else if (wiresXCommandPassthrough) {
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
} else {
m_exclude = (dt == YSF_DT_DATA_FR_MODE);
processDTMF(buffer, dt);
processWiresX(buffer, fi, dt, fn, ft, false, wiresXCommandPassthrough);
}
if (m_gps != NULL)
m_gps->data(buffer + 14U, buffer + 35U, fi, dt, fn, ft);
@ -460,21 +460,21 @@ void CYSFGateway::createGPS()
bool enabled = m_conf.getMobileGPSEnabled();
if (enabled) {
std::string address = m_conf.getMobileGPSAddress();
unsigned int port = m_conf.getMobileGPSPort();
std::string address = m_conf.getMobileGPSAddress();
unsigned int port = m_conf.getMobileGPSPort();
m_writer->setMobileLocation(address, port);
m_writer->setMobileLocation(address, port);
} else {
float latitude = m_conf.getLatitude();
float longitude = m_conf.getLongitude();
int height = m_conf.getHeight();
float latitude = m_conf.getLatitude();
float longitude = m_conf.getLongitude();
int height = m_conf.getHeight();
m_writer->setStaticLocation(latitude, longitude, height);
m_writer->setStaticLocation(latitude, longitude, height);
}
bool ret = m_writer->open();
if (!ret) {
delete m_writer;
delete m_writer;
m_writer = NULL;
return;
}
@ -550,9 +550,9 @@ void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, u
// If we are linking to a YSF2xxx mode, send the YSF2xxx gateway the link command too
if (reflector->m_wiresX && wiresXCommandPassthrough) {
LogMessage("Forward WiresX Connect to \"%s\"", reflector->m_name.c_str());
m_wiresX->sendConnect(m_ysfNetwork);
}
LogMessage("Forward WiresX Connect to \"%s\"", reflector->m_name.c_str());
m_wiresX->sendConnect(m_ysfNetwork);
}
}
break;
case WXS_CONNECT_FCS: {
@ -659,43 +659,43 @@ void CYSFGateway::processDTMF(unsigned char* buffer, unsigned char dt)
}
break;
case WXS_CONNECT_FCS: {
std::string raw = m_dtmf.getReflector();
std::string id = "FCS00";
if (raw.length() == 2U) {
id += raw.at(0U) + std::string("0") + raw.at(1U);
} else if (raw.length() == 3U) {
id += raw;
} else {
LogWarning("Nonsense from the DTMF decoder - \"%s\"", raw.c_str());
return;
}
std::string raw = m_dtmf.getReflector();
std::string id = "FCS00";
if (raw.length() == 2U) {
id += raw.at(0U) + std::string("0") + raw.at(1U);
} else if (raw.length() == 3U) {
id += raw;
} else {
LogWarning("Nonsense from the DTMF decoder - \"%s\"", raw.c_str());
return;
}
if (m_linkType == LINK_YSF) {
m_wiresX->processDisconnect();
m_ysfNetwork->writeUnlink(3U);
m_ysfNetwork->clearDestination();
}
if (m_linkType == LINK_FCS)
m_fcsNetwork->writeUnlink(3U);
if (m_linkType == LINK_YSF) {
m_wiresX->processDisconnect();
m_ysfNetwork->writeUnlink(3U);
m_ysfNetwork->clearDestination();
}
if (m_linkType == LINK_FCS)
m_fcsNetwork->writeUnlink(3U);
m_current.clear();
m_inactivityTimer.stop();
m_lostTimer.stop();
m_linkType = LINK_NONE;
m_current.clear();
m_inactivityTimer.stop();
m_lostTimer.stop();
m_linkType = LINK_NONE;
LogMessage("Connect via DTMF to %s has been requested by %10.10s", id.c_str(), buffer + 14U);
LogMessage("Connect via DTMF to %s has been requested by %10.10s", id.c_str(), buffer + 14U);
bool ok = m_fcsNetwork->writeLink(id);
if (ok) {
m_current = id;
m_inactivityTimer.start();
m_lostTimer.start();
m_linkType = LINK_FCS;
} else {
LogMessage("Unknown reflector - %s", id.c_str());
bool ok = m_fcsNetwork->writeLink(id);
if (ok) {
m_current = id;
m_inactivityTimer.start();
m_lostTimer.start();
m_linkType = LINK_FCS;
} else {
LogMessage("Unknown reflector - %s", id.c_str());
}
}
}
break;
break;
case WXS_DISCONNECT:
if (m_linkType == LINK_YSF) {
m_wiresX->processDisconnect();
@ -820,7 +820,7 @@ void CYSFGateway::startupLinking()
}
}
if (m_startup.empty())
LogMessage("No connection startup");
LogMessage("No connection startup");
}
void CYSFGateway::readFCSRoomsFile(const std::string& filename)

@ -68,13 +68,6 @@ const unsigned int INTERLEAVE_TABLE_5_20[] = {
36U, 76U, 116U, 156U, 196U,
38U, 78U, 118U, 158U, 198U};
// This one differs from the others in that it interleaves bits and not dibits
const unsigned int INTERLEAVE_TABLE_26_4[] = {
0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U, 32U, 36U, 40U, 44U, 48U, 52U, 56U, 60U, 64U, 68U, 72U, 76U, 80U, 84U, 88U, 92U, 96U, 100U,
1U, 5U, 9U, 13U, 17U, 21U, 25U, 29U, 33U, 37U, 41U, 45U, 49U, 53U, 57U, 61U, 65U, 69U, 73U, 77U, 81U, 85U, 89U, 93U, 97U, 101U,
2U, 6U, 10U, 14U, 18U, 22U, 26U, 30U, 34U, 38U, 42U, 46U, 50U, 54U, 58U, 62U, 66U, 70U, 74U, 78U, 82U, 86U, 90U, 94U, 98U, 102U,
3U, 7U, 11U, 15U, 19U, 23U, 27U, 31U, 35U, 39U, 43U, 47U, 51U, 55U, 59U, 63U, 67U, 71U, 75U, 79U, 83U, 87U, 91U, 95U, 99U, 103U};
const unsigned char WHITENING_DATA[] = {0x93U, 0xD7U, 0x51U, 0x21U, 0x9CU, 0x2FU, 0x6CU, 0xD0U, 0xEFU, 0x0FU,
0xF8U, 0x3DU, 0xF1U, 0x73U, 0x20U, 0x94U, 0xEDU, 0x1EU, 0x7CU, 0xD8U};

Loading…
Cancel
Save