diff --git a/Common/APRSHandlerThread.cpp b/Common/APRSISHandlerThread.cpp similarity index 89% rename from Common/APRSHandlerThread.cpp rename to Common/APRSISHandlerThread.cpp index 494e474..a060fe1 100644 --- a/Common/APRSHandlerThread.cpp +++ b/Common/APRSISHandlerThread.cpp @@ -21,7 +21,7 @@ #include #include -#include "APRSHandlerThread.h" +#include "APRSISHandlerThread.h" #include "DStarDefines.h" #include "Utils.h" #include "Defs.h" @@ -36,7 +36,7 @@ const unsigned int APRS_TIMEOUT = 10U; const unsigned int APRS_READ_TIMEOUT = 1U; const unsigned int APRS_KEEP_ALIVE_TIMEOUT = 60U; -CAPRSHandlerThread::CAPRSHandlerThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port) : +CAPRSISHandlerThread::CAPRSISHandlerThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port) : CThread("APRS"), m_username(callsign), m_password(password), @@ -64,7 +64,7 @@ m_clientName(FULL_PRODUCT_NAME) m_ssid = m_ssid.substr(LONG_CALLSIGN_LENGTH - 1U, 1); } -CAPRSHandlerThread::CAPRSHandlerThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port, const std::string& filter) : +CAPRSISHandlerThread::CAPRSISHandlerThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port, const std::string& filter) : CThread("APRS"), m_username(callsign), m_password(password), @@ -92,7 +92,7 @@ m_clientName(FULL_PRODUCT_NAME) m_ssid = m_ssid.substr(LONG_CALLSIGN_LENGTH - 1U, 1); } -CAPRSHandlerThread::~CAPRSHandlerThread() +CAPRSISHandlerThread::~CAPRSISHandlerThread() { std::vector callBacksCopy; callBacksCopy.assign(m_APRSReadCallbacks.begin(), m_APRSReadCallbacks.end()); @@ -105,7 +105,7 @@ CAPRSHandlerThread::~CAPRSHandlerThread() m_password.clear(); } -bool CAPRSHandlerThread::start() +bool CAPRSISHandlerThread::start() { Create(); Run(); @@ -113,7 +113,7 @@ bool CAPRSHandlerThread::start() return true; } -void* CAPRSHandlerThread::Entry() +void* CAPRSISHandlerThread::Entry() { CLog::logInfo("Starting the APRS Writer thread"); @@ -214,13 +214,13 @@ void* CAPRSHandlerThread::Entry() return NULL; } -void CAPRSHandlerThread::addReadAPRSCallback(IReadAPRSFrameCallback * cb) +void CAPRSISHandlerThread::addReadAPRSCallback(IReadAPRSFrameCallback * cb) { assert(cb != nullptr); m_APRSReadCallbacks.push_back(cb); } -void CAPRSHandlerThread::write(CAPRSFrame& frame) +void CAPRSISHandlerThread::write(CAPRSFrame& frame) { if (!m_connected) return; @@ -235,25 +235,25 @@ void CAPRSHandlerThread::write(CAPRSFrame& frame) } } -bool CAPRSHandlerThread::isConnected() const +bool CAPRSISHandlerThread::isConnected() const { return m_connected; } -void CAPRSHandlerThread::stop() +void CAPRSISHandlerThread::stop() { m_exit = true; Wait(); } -void CAPRSHandlerThread::clock(unsigned int ms) +void CAPRSISHandlerThread::clock(unsigned int ms) { m_reconnectTimer.clock(ms); m_keepAliveTimer.clock(ms); } -bool CAPRSHandlerThread::connect() +bool CAPRSISHandlerThread::connect() { m_socket.close(); bool ret = m_socket.open(); @@ -304,7 +304,7 @@ bool CAPRSHandlerThread::connect() return true; } -void CAPRSHandlerThread::startReconnectionTimer() +void CAPRSISHandlerThread::startReconnectionTimer() { // Clamp at a ten minutes reconnect time m_tries++; diff --git a/Common/APRSHandlerThread.h b/Common/APRSISHandlerThread.h similarity index 80% rename from Common/APRSHandlerThread.h rename to Common/APRSISHandlerThread.h index 3cff8c5..4be743e 100644 --- a/Common/APRSHandlerThread.h +++ b/Common/APRSISHandlerThread.h @@ -29,11 +29,11 @@ #include "APRSFrame.h" -class CAPRSHandlerThread : public CThread, IAPRSHandlerBackend { +class CAPRSISHandlerThread : public CThread, IAPRSHandlerBackend { public: - CAPRSHandlerThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port); - CAPRSHandlerThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port, const std::string& filter); - virtual ~CAPRSHandlerThread(); + CAPRSISHandlerThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port); + CAPRSISHandlerThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port, const std::string& filter); + virtual ~CAPRSISHandlerThread(); bool start(); diff --git a/Common/RepeaterHandler.cpp b/Common/RepeaterHandler.cpp index b6573df..3fbb913 100644 --- a/Common/RepeaterHandler.cpp +++ b/Common/RepeaterHandler.cpp @@ -59,8 +59,8 @@ bool CRepeaterHandler::m_dtmfEnabled = true; CHeaderLogger* CRepeaterHandler::m_headerLogger = NULL; -CAPRSHandler* CRepeaterHandler::m_outgoingAprsHandler = NULL; -CAPRSHandler* CRepeaterHandler::m_incomingAprsHandler = NULL; +CAPRSHandler* CRepeaterHandler::m_outgoingAprsHandler = NULL; //handles APRS/DPRS frames coming from radio to network +CAPRSHandler* CRepeaterHandler::m_incomingAprsHandler = NULL; //handles APRS/DPRS frames coming from network to radio CCallsignList* CRepeaterHandler::m_restrictList = NULL; diff --git a/DStarGateway/DStarGatewayApp.cpp b/DStarGateway/DStarGatewayApp.cpp index e218e12..a62550b 100644 --- a/DStarGateway/DStarGatewayApp.cpp +++ b/DStarGateway/DStarGatewayApp.cpp @@ -48,7 +48,7 @@ #include "APRSGPSDIdFrameProvider.h" #include "APRSFixedIdFrameProvider.h" #include "Daemon.h" -#include "APRSHandlerThread.h" +#include "APRSISHandlerThread.h" #include "DummyAPRSHandlerThread.h" CDStarGatewayApp * CDStarGatewayApp::g_app = nullptr; @@ -197,8 +197,8 @@ bool CDStarGatewayApp::createThread() CAPRSHandler * outgoingAprsWriter = nullptr; CAPRSHandler * incomingAprsWriter = nullptr; if(aprsConfig.enabled && !aprsConfig.password.empty()) { - CAPRSHandlerThread* thread = new CAPRSHandlerThread(gatewayConfig.callsign, aprsConfig.password, gatewayConfig.address, aprsConfig.hostname, aprsConfig.port); - outgoingAprsWriter = new CAPRSHandler((IAPRSHandlerBackend *)thread); + CAPRSISHandlerThread* aprsisthread = new CAPRSISHandlerThread(gatewayConfig.callsign, aprsConfig.password, gatewayConfig.address, aprsConfig.hostname, aprsConfig.port); + outgoingAprsWriter = new CAPRSHandler((IAPRSHandlerBackend *)aprsisthread); incomingAprsWriter = new CAPRSHandler((IAPRSHandlerBackend *)new CDummyAPRSHandlerBackend());