#12 Rename APRSWriterThread -> APRSHandlerThread

pull/32/head
Geoffrey Merck 4 years ago
parent a969590099
commit c512e2894a

@ -47,7 +47,7 @@ m_idFrameProvider(nullptr)
assert(!gateway.empty());
assert(!password.empty());
m_thread = new CAPRSWriterThread(gateway, password, address, hostname, port);
m_thread = new CAPRSHandlerThread(gateway, password, address, hostname, port);
m_gateway = gateway;
m_gateway = m_gateway.substr(0, LONG_CALLSIGN_LENGTH - 1U);

@ -26,7 +26,7 @@
#include "APRSEntry.h"
#include "APRSWriterThread.h"
#include "APRSHandlerThread.h"
#include "UDPReaderWriter.h"
#include "APRSCollector.h"
#include "DStarDefines.h"
@ -59,7 +59,7 @@ public:
void close();
private:
CAPRSWriterThread* m_thread;
CAPRSHandlerThread* m_thread;
std::string m_gateway;
in_addr m_address;
unsigned int m_port;

@ -21,7 +21,7 @@
#include <iostream>
#include <boost/algorithm/string.hpp>
#include "APRSWriterThread.h"
#include "APRSHandlerThread.h"
#include "DStarDefines.h"
#include "Utils.h"
#include "Defs.h"
@ -34,7 +34,7 @@
const unsigned int APRS_TIMEOUT = 10U;
CAPRSWriterThread::CAPRSWriterThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port) :
CAPRSHandlerThread::CAPRSHandlerThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port) :
CThread(),
m_username(callsign),
m_password(password),
@ -61,7 +61,7 @@ m_clientName(FULL_PRODUCT_NAME)
m_ssid = m_ssid.substr(LONG_CALLSIGN_LENGTH - 1U, 1);
}
CAPRSWriterThread::CAPRSWriterThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port, const std::string& filter, const std::string& clientName) :
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, const std::string& clientName) :
CThread(),
m_username(callsign),
m_password(password),
@ -88,7 +88,7 @@ m_clientName(clientName)
m_ssid = m_ssid.substr(LONG_CALLSIGN_LENGTH - 1U, 1);
}
CAPRSWriterThread::~CAPRSWriterThread()
CAPRSHandlerThread::~CAPRSHandlerThread()
{
std::vector<CReadAPRSFrameCallback *> callBacksCopy;
callBacksCopy.assign(m_APRSReadCallbacks.begin(), m_APRSReadCallbacks.end());
@ -105,7 +105,7 @@ CAPRSWriterThread::~CAPRSWriterThread()
m_password.clear();
}
bool CAPRSWriterThread::start()
bool CAPRSHandlerThread::start()
{
Create();
Run();
@ -113,7 +113,7 @@ bool CAPRSWriterThread::start()
return true;
}
void* CAPRSWriterThread::Entry()
void* CAPRSHandlerThread::Entry()
{
CLog::logInfo("Starting the APRS Writer thread");
@ -207,13 +207,13 @@ void* CAPRSWriterThread::Entry()
return NULL;
}
void CAPRSWriterThread::addReadAPRSCallback(CReadAPRSFrameCallback * cb)
void CAPRSHandlerThread::addReadAPRSCallback(CReadAPRSFrameCallback * cb)
{
assert(cb != nullptr);
m_APRSReadCallbacks.push_back(cb);
}
void CAPRSWriterThread::write(CAPRSFrame& frame)
void CAPRSHandlerThread::write(CAPRSFrame& frame)
{
if (!m_connected)
return;
@ -228,24 +228,24 @@ void CAPRSWriterThread::write(CAPRSFrame& frame)
}
}
bool CAPRSWriterThread::isConnected() const
bool CAPRSHandlerThread::isConnected() const
{
return m_connected;
}
void CAPRSWriterThread::stop()
void CAPRSHandlerThread::stop()
{
m_exit = true;
Wait();
}
void CAPRSWriterThread::clock(unsigned int ms)
void CAPRSHandlerThread::clock(unsigned int ms)
{
m_reconnectTimer.clock(ms);
}
bool CAPRSWriterThread::connect()
bool CAPRSHandlerThread::connect()
{
bool ret = m_socket.open();
if (!ret)
@ -295,7 +295,7 @@ bool CAPRSWriterThread::connect()
return true;
}
void CAPRSWriterThread::startReconnectionTimer()
void CAPRSHandlerThread::startReconnectionTimer()
{
// Clamp at a ten minutes reconnect time
m_tries++;

@ -29,11 +29,11 @@
#include "APRSFrame.h"
class CAPRSWriterThread : public CThread {
class CAPRSHandlerThread : public CThread {
public:
CAPRSWriterThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port);
CAPRSWriterThread(const std::string& callsign, const std::string& password, const std::string& address, const std::string& hostname, unsigned int port, const std::string& filter, const std::string& clientName);
virtual ~CAPRSWriterThread();
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, const std::string& clientName);
virtual ~CAPRSHandlerThread();
bool start();
Loading…
Cancel
Save

Powered by TurnKey Linux.