From dd4549a7536ac5c90f5822ce5e017c376091b4a6 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 6 Nov 2018 19:52:30 +0000 Subject: [PATCH] Fix compile issues. --- Common/APRSWriter.cpp | 4 ++-- Common/APRSWriter.h | 4 ++-- Common/UDPReaderWriter.cpp | 30 ++++++++++++++++++++++++++++- Common/UDPReaderWriter.h | 4 +++- ircDDBGateway/IRCDDBGatewayApp.cpp | 18 ++++++++--------- ircDDBGateway/IRCDDBGatewayAppD.cpp | 18 ++++++++--------- 6 files changed, 54 insertions(+), 24 deletions(-) diff --git a/Common/APRSWriter.cpp b/Common/APRSWriter.cpp index b027e34..d0d840e 100644 --- a/Common/APRSWriter.cpp +++ b/Common/APRSWriter.cpp @@ -290,10 +290,10 @@ void CAPRSWriter::clock(unsigned int ms) m_idTimer.start(); } - sendIdFrameMobile(); + sendIdFramesMobile(); } else { if (m_idTimer.hasExpired()) { - sendIdFrameFixed(); + sendIdFramesFixed(); m_idTimer.start(); } } diff --git a/Common/APRSWriter.h b/Common/APRSWriter.h index 7e7438b..9b54760 100644 --- a/Common/APRSWriter.h +++ b/Common/APRSWriter.h @@ -73,9 +73,9 @@ public: bool open(); - void setFixedPort(const wxString& callsign, const wxString& band, double frequency, double offset, double range, double latitude, double longitude, double agl); + void setPortFixed(const wxString& callsign, const wxString& band, double frequency, double offset, double range, double latitude, double longitude, double agl); - void setMobilePort(const wxString& callsign, const wxString& band, double frequency, double offset, double range, const wxString& address, unsigned int port); + void setPortMobile(const wxString& callsign, const wxString& band, double frequency, double offset, double range, const wxString& address, unsigned int port); void writeHeader(const wxString& callsign, const CHeaderData& header); diff --git a/Common/UDPReaderWriter.cpp b/Common/UDPReaderWriter.cpp index 5a18a8e..9e9063b 100644 --- a/Common/UDPReaderWriter.cpp +++ b/Common/UDPReaderWriter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2014 by Jonathan Naylor G4KLX + * Copyright (C) 2006-2014,2018 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +37,34 @@ m_fd(-1) #endif } +CUDPReaderWriter::CUDPReaderWriter(unsigned int port) : +m_address(), +m_port(port), +m_addr(), +m_fd(-1) +{ +#if defined(__WINDOWS__) + WSAData data; + int wsaRet = ::WSAStartup(MAKEWORD(2, 2), &data); + if (wsaRet != 0) + wxLogError(wxT("Error from WSAStartup")); +#endif +} + +CUDPReaderWriter::CUDPReaderWriter() : +m_address(), +m_port(0U), +m_addr(), +m_fd(-1) +{ +#if defined(__WINDOWS__) + WSAData data; + int wsaRet = ::WSAStartup(MAKEWORD(2, 2), &data); + if (wsaRet != 0) + wxLogError(wxT("Error from WSAStartup")); +#endif +} + CUDPReaderWriter::~CUDPReaderWriter() { #if defined(__WINDOWS__) diff --git a/Common/UDPReaderWriter.h b/Common/UDPReaderWriter.h index 4167662..fd60c1d 100644 --- a/Common/UDPReaderWriter.h +++ b/Common/UDPReaderWriter.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2011,2013 by Jonathan Naylor G4KLX + * Copyright (C) 2009-2011,2013,2018 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +35,8 @@ class CUDPReaderWriter { public: CUDPReaderWriter(const wxString& address, unsigned int port); + CUDPReaderWriter(unsigned int port); + CUDPReaderWriter(); ~CUDPReaderWriter(); static in_addr lookup(const wxString& hostName); diff --git a/ircDDBGateway/IRCDDBGatewayApp.cpp b/ircDDBGateway/IRCDDBGatewayApp.cpp index 798183e..dc563d4 100644 --- a/ircDDBGateway/IRCDDBGatewayApp.cpp +++ b/ircDDBGateway/IRCDDBGatewayApp.cpp @@ -280,7 +280,7 @@ void CIRCDDBGatewayApp::createThread() wxString mobileGPSAddress; unsigned int mobileGPSPort; m_config->getMobileGPS(mobileGPSEnabled, mobileGPSAddress, mobileGPSPort); - wxLogInfo(wxT("Mobile GPS: %d, address: %s, port: %u"), int(mobileGPSEnabled), mobileGPSAddress.c_str(), m_mobileGPSPort); + wxLogInfo(wxT("Mobile GPS: %d, address: %s, port: %u"), int(mobileGPSEnabled), mobileGPSAddress.c_str(), mobileGPSPort); CIcomRepeaterProtocolHandler* icomRepeaterHandler = NULL; CHBRepeaterProtocolHandler* hbRepeaterHandler = NULL; @@ -359,7 +359,7 @@ void CIRCDDBGatewayApp::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign1, repeaterBand1, frequency1, offset1, range1, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign1, repeaterBand1, frequency1, offset1, range1, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); } @@ -370,7 +370,7 @@ void CIRCDDBGatewayApp::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign1, repeaterBand1, frequency1, offset1, range1, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign1, repeaterBand1, frequency1, offset1, range1, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); } @@ -455,7 +455,7 @@ void CIRCDDBGatewayApp::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign2, repeaterBand2, frequency2, offset2, range2, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign2, repeaterBand2, frequency2, offset2, range2, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl2); } @@ -466,7 +466,7 @@ void CIRCDDBGatewayApp::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign2, repeaterBand2, frequency2, offset2, range2, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign2, repeaterBand2, frequency2, offset2, range2, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl2); } @@ -555,7 +555,7 @@ void CIRCDDBGatewayApp::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign3, repeaterBand3, frequency3, offset3, range3, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign3, repeaterBand3, frequency3, offset3, range3, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); } @@ -566,7 +566,7 @@ void CIRCDDBGatewayApp::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign3, repeaterBand3, frequency3, offset3, range3, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign3, repeaterBand3, frequency3, offset3, range3, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); } @@ -659,7 +659,7 @@ void CIRCDDBGatewayApp::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign4, repeaterBand4, frequency4, offset4, range4, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign4, repeaterBand4, frequency4, offset4, range4, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); } @@ -670,7 +670,7 @@ void CIRCDDBGatewayApp::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign4, repeaterBand4, frequency4, offset4, range4, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign4, repeaterBand4, frequency4, offset4, range4, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); } diff --git a/ircDDBGateway/IRCDDBGatewayAppD.cpp b/ircDDBGateway/IRCDDBGatewayAppD.cpp index 00122c4..4fc59be 100644 --- a/ircDDBGateway/IRCDDBGatewayAppD.cpp +++ b/ircDDBGateway/IRCDDBGatewayAppD.cpp @@ -269,7 +269,7 @@ bool CIRCDDBGatewayAppD::createThread() wxString mobileGPSAddress; unsigned int mobileGPSPort; config.getMobileGPS(mobileGPSEnabled, mobileGPSAddress, mobileGPSPort); - wxLogInfo(wxT("Mobile GPS: %d, address: %s, port: %u"), int(mobileGPSEnabled), mobileGPSAddress.c_str(), m_mobileGPSPort); + wxLogInfo(wxT("Mobile GPS: %d, address: %s, port: %u"), int(mobileGPSEnabled), mobileGPSAddress.c_str(), mobileGPSPort); CIcomRepeaterProtocolHandler* icomRepeaterHandler = NULL; CHBRepeaterProtocolHandler* hbRepeaterHandler = NULL; @@ -348,7 +348,7 @@ bool CIRCDDBGatewayAppD::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign1, repeaterBand1, frequency1, offset1, range1, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign1, repeaterBand1, frequency1, offset1, range1, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); } @@ -359,7 +359,7 @@ bool CIRCDDBGatewayAppD::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign1, repeaterBand1, frequency1, offset1, range1, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign1, repeaterBand1, frequency1, offset1, range1, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); } @@ -444,7 +444,7 @@ bool CIRCDDBGatewayAppD::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign2, repeaterBand2, frequency2, offset2, range2, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign2, repeaterBand2, frequency2, offset2, range2, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl2); } @@ -455,7 +455,7 @@ bool CIRCDDBGatewayAppD::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign2, repeaterBand2, frequency2, offset2, range2, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign2, repeaterBand2, frequency2, offset2, range2, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl1); } @@ -544,7 +544,7 @@ bool CIRCDDBGatewayAppD::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign3, repeaterBand3, frequency3, offset3, range3, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign3, repeaterBand3, frequency3, offset3, range3, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); } @@ -555,7 +555,7 @@ bool CIRCDDBGatewayAppD::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign3, repeaterBand3, frequency3, offset3, range3, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign3, repeaterBand3, frequency3, offset3, range3, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); } @@ -648,7 +648,7 @@ bool CIRCDDBGatewayAppD::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign4, repeaterBand4, frequency4, offset4, range4, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign4, repeaterBand4, frequency4, offset4, range4, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); } @@ -659,7 +659,7 @@ bool CIRCDDBGatewayAppD::createThread() if (aprs != NULL) { if (mobileGPSEnabled) - aprs->setPortMobile(callsign4, repeaterBand4, frequency4, offset4, range4, m_mobileGPSAddress, m_mobileGPSPort); + aprs->setPortMobile(callsign4, repeaterBand4, frequency4, offset4, range4, mobileGPSAddress, mobileGPSPort); else aprs->setPortFixed(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); }