diff --git a/.gitignore b/.gitignore index e3bcc9a..5b78d6c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ Release *.bak .vs *.a - +*.d diff --git a/APRSTransmit/APRSTransmit.cpp b/APRSTransmit/APRSTransmit.cpp index e50393d..b5ae92f 100644 --- a/APRSTransmit/APRSTransmit.cpp +++ b/APRSTransmit/APRSTransmit.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 by Jonathan Naylor G4KLX + * Copyright (C) 2014,2020 by Jonathan Naylor G4KLX * APRSTransmit Copyright (C) 2015 Geoffrey Merck F4FXL / KC3FRA * * This program is free software; you can redistribute it and/or modify @@ -24,7 +24,7 @@ CAPRSTransmit::CAPRSTransmit(const wxString& callsign, const wxString& text) : -m_socket(wxEmptyString, 0U), +m_socket(), m_repeaterCallsign(callsign), m_APRSCallsign(callsign), m_text(text) diff --git a/APRSTransmit/APRSTransmit.vcxproj b/APRSTransmit/APRSTransmit.vcxproj index 96a54ae..8c383ab 100644 --- a/APRSTransmit/APRSTransmit.vcxproj +++ b/APRSTransmit/APRSTransmit.vcxproj @@ -22,29 +22,29 @@ {F26EA1DB-74CF-4C52-A425-00235C8ABED2} APRSTransmit Win32Proj - 10.0.16299.0 + 10.0 Application - v141 + v142 Unicode true Application - v141 + v142 Unicode true Application - v141 + v142 Unicode Application - v141 + v142 Unicode @@ -80,9 +80,11 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName) false + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) false + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) diff --git a/APRSTransmit/APRSTransmitAppD.cpp b/APRSTransmit/APRSTransmitAppD.cpp index 60f18aa..272e0b2 100644 --- a/APRSTransmit/APRSTransmitAppD.cpp +++ b/APRSTransmit/APRSTransmitAppD.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 by Jonathan Naylor G4KLX + * Copyright (C) 2014,2018,2020 by Jonathan Naylor G4KLX * APRSTransmit Copyright (C) 2015 Geoffrey Merck F4FXL / KC3FRA * * This program is free software; you can redistribute it and/or modify @@ -20,7 +20,6 @@ #include "DStarDefines.h" #include "APRSTransmit.h" #include "APRSTransmitAppD.h" -#include "APRSWriterThread.h" #include #include @@ -35,7 +34,6 @@ const wxChar* REPEATER_PARAM = wxT("Repeater"); const wxChar* APRS_HOST = wxT("host"); const wxChar* APRS_PORT = wxT("port"); -const wxChar* APRS_FILTER = wxT("filter"); const wxChar* DAEMON_SWITCH = wxT("daemon"); static CAPRSTransmitAppD* m_aprsTransmit = NULL; @@ -45,12 +43,6 @@ static void handler(int signum) m_aprsTransmit->kill(); } -static void aprsFrameCallback(const wxString& aprsFrame) -{ - //wxLogMessage(wxT("Received APRS Frame : ") + aprsFrame); - m_aprsTransmit->m_aprsFramesQueue->addData(new wxString(aprsFrame.Clone())); -} - int main(int argc, char** argv) { bool res = ::wxInitialize(); @@ -63,7 +55,6 @@ int main(int argc, char** argv) parser.AddParam(REPEATER_PARAM, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); parser.AddOption(APRS_HOST, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); parser.AddOption(APRS_PORT, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_NUMBER, wxCMD_LINE_PARAM_OPTIONAL); - parser.AddOption(APRS_FILTER, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); parser.AddSwitch(DAEMON_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); int cmd = parser.Parse(); @@ -73,7 +64,7 @@ int main(int argc, char** argv) } if (parser.GetParamCount() < 1U) { - ::fprintf(stderr, "aprstransmitd: invalid command line usage: aprstransmitd [-host ] [-port ] [-filter [; [-host ] [-port ] [-daemon] exiting\n"); ::wxUninitialize(); return 1; } @@ -89,28 +80,19 @@ int main(int argc, char** argv) } repeater.Replace(wxT("_"), wxT(" ")); repeater.MakeUpper(); - + long aprsPort; - if(!parser.Found(APRS_PORT, &aprsPort)) - aprsPort = 14580; + if (!parser.Found(APRS_PORT, &aprsPort)) + aprsPort = 14580L; wxString aprsHost; - if(!parser.Found(APRS_HOST, &aprsHost)){ + if (!parser.Found(APRS_HOST, &aprsHost)) aprsHost = wxT("rotate.aprs2.net"); - } - - wxString aprsFilter; - if(!parser.Found(APRS_FILTER, &aprsFilter)) { - /* no filter specified on command line, - build one which will tell the APRS server to pass - us all stations 50km around our repeater */ - aprsFilter = wxT("m/50"); - } bool daemon = parser.Found(DAEMON_SWITCH); #if defined(__WINDOWS__) - m_aprsTransmit = new CAPRSTransmitAppD(repeater, aprsHost, aprsPort, aprsFilter, daemon); + m_aprsTransmit = new CAPRSTransmitAppD(repeater, aprsHost, aprsPort, daemon); if (!m_aprsTransmit->init()) { ::wxUninitialize(); return 1; @@ -143,7 +125,7 @@ int main(int argc, char** argv) ::fclose(fp); } - m_aprsTransmit = new CAPRSTransmitAppD(repeater, aprsHost, aprsPort, aprsFilter, daemon); + m_aprsTransmit = new CAPRSTransmitAppD(repeater, aprsHost, aprsPort, daemon); if (!m_aprsTransmit->init()) { ::wxUninitialize(); return 1; @@ -162,13 +144,12 @@ int main(int argc, char** argv) -CAPRSTransmitAppD::CAPRSTransmitAppD(const wxString& repeater, const wxString& aprsHost, unsigned int aprsPort, const wxString& aprsFilter, bool daemon) : +CAPRSTransmitAppD::CAPRSTransmitAppD(const wxString& repeater, const wxString& aprsHost, unsigned int aprsPort, bool daemon) : m_aprsFramesQueue(NULL), m_repeater(repeater), m_aprsHost(aprsHost), -m_aprsFilter(aprsFilter), m_aprsPort(aprsPort), -m_aprsThread(NULL), +m_aprsSocket(NULL), m_run(false), m_checker(NULL), m_daemon(daemon) @@ -220,9 +201,8 @@ void CAPRSTransmitAppD::run() if(m_run) return; m_aprsFramesQueue = new CRingBuffer(30U); - m_aprsThread = new CAPRSWriterThread(m_repeater, wxT("0.0.0.0"), m_aprsHost, m_aprsPort, m_aprsFilter, wxT("APRSTransmit 1.1")); - m_aprsThread->setReadAPRSCallback(aprsFrameCallback); - m_aprsThread->start(); + m_aprsSocket = new CUDPReaderWriter; + m_aprsSocket->open(); wxString * aprsFrame; @@ -230,38 +210,36 @@ void CAPRSTransmitAppD::run() while(m_run){ wxMilliSleep(10U); aprsFrame = m_aprsFramesQueue->getData(); - if(aprsFrame){ + if (aprsFrame != NULL) { CAPRSTransmit aprsTransmit(m_repeater, wxString(*aprsFrame)); aprsTransmit.run(); delete aprsFrame; } } - m_aprsThread->stop(); - cleanup(); } void CAPRSTransmitAppD::cleanup() { - m_aprsThread->setReadAPRSCallback(NULL); - - if(m_aprsFramesQueue) + if (m_aprsFramesQueue != NULL) { - while(m_aprsFramesQueue->peek()) delete m_aprsFramesQueue->getData(); + while (m_aprsFramesQueue->peek()) delete m_aprsFramesQueue->getData(); delete m_aprsFramesQueue; m_aprsFramesQueue = NULL; } - if(m_checker) { + + if (m_checker != NULL) { delete m_checker; m_checker = NULL; } - if(m_aprsThread) + if (m_aprsSocket != NULL) { - delete m_aprsThread; - m_aprsThread = NULL; + m_aprsSocket->close(); + delete m_aprsSocket; + m_aprsSocket = NULL; } } diff --git a/APRSTransmit/APRSTransmitAppD.h b/APRSTransmit/APRSTransmitAppD.h index 815a16b..80b0734 100644 --- a/APRSTransmit/APRSTransmitAppD.h +++ b/APRSTransmit/APRSTransmitAppD.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 by Jonathan Naylor G4KLX + * Copyright (C) 2014,2018,2020 by Jonathan Naylor G4KLX * APRSTransmit Copyright (C) 2015 Geoffrey Merck F4FXL / KC3FRA * * This program is free software; you can redistribute it and/or modify @@ -20,8 +20,8 @@ #ifndef APRSTransmitAppD_H #define APRSTransmitAppD_H +#include "UDPReaderWriter.h" #include "RingBuffer.h" -#include "APRSWriterThread.h" #include #include @@ -31,7 +31,7 @@ class CAPRSTransmitAppD { public: - CAPRSTransmitAppD(const wxString& repeater, const wxString& aprsHost, unsigned int aprsPort, const wxString& aprsFilter, bool daemon); + CAPRSTransmitAppD(const wxString& repeater, const wxString& aprsHost, unsigned int aprsPort, bool daemon); ~CAPRSTransmitAppD(); CRingBuffer * m_aprsFramesQueue; @@ -41,9 +41,9 @@ public: void kill(); private: - wxString m_repeater, m_aprsHost, m_aprsFilter; + wxString m_repeater, m_aprsHost; unsigned int m_aprsPort; - CAPRSWriterThread * m_aprsThread; + CUDPReaderWriter * m_aprsSocket; bool m_run; wxSingleInstanceChecker * m_checker; bool m_daemon; diff --git a/APRSTransmit/APRSTransmitD.vcxproj b/APRSTransmit/APRSTransmitD.vcxproj index 7c3486c..8c76d99 100644 --- a/APRSTransmit/APRSTransmitD.vcxproj +++ b/APRSTransmit/APRSTransmitD.vcxproj @@ -22,29 +22,29 @@ {C706EF5D-3917-4796-8BEB-823498A1B13C} APRSTransmit Win32Proj - 10.0.16299.0 + 10.0 Application - v141 + v142 Unicode true Application - v141 + v142 Unicode true Application - v141 + v142 Unicode Application - v141 + v142 Unicode @@ -80,9 +80,11 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ false + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) false + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) diff --git a/APRSTransmit/Makefile b/APRSTransmit/Makefile index 8814c53..c6d50c8 100644 --- a/APRSTransmit/Makefile +++ b/APRSTransmit/Makefile @@ -1,16 +1,24 @@ OBJECTS = APRSParser.o APRSTransmitAppD.o APRSTransmit.o +.PHONY: all all: aprstransmitd -aprstransmitd: $(OBJECTS) +aprstransmitd: $(OBJECTS) ../Common/Common.a $(CXX) $(OBJECTS) ../Common/Common.a $(LDFLAGS) $(LIBS) -o aprstransmitd +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../Common -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common $< > $*.d +.PHONY: install install: - install -g bin -o root -m 0775 aprstransmitd $(BINDIR) + install -g root -o root -m 0755 aprstransmitd $(DESTDIR)$(BINDIR) +.PHONY: clean clean: $(RM) aprstransmitd *.o *.d *.bak *~ +../Common/Common.a: + diff --git a/BUILD.md b/BUILD.md new file mode 100644 index 0000000..a3b8623 --- /dev/null +++ b/BUILD.md @@ -0,0 +1,85 @@ +# Building ircDDBGateway + +## Windows + +To use the ircDDB Gateway software you will first need to build the latest +version of wxWidgets (http://www.wxwidgets.org), the version I used was 3.0.4. +I also installed it in the default location which is C:\wxWidgets-3.0.4. + +For compiling I use Visual C++ 2017 Community Edition downloaded from Microsoft +for free. I recommend that you use the same. + +To build wxWidgets, you simply need to open Visual Studio 2017 using the File -> +Open -> Projects/Solutions and load the wx_vc12.sln file to be found in +wxWidgets-3.0.4\build\msw directory and then go into Batch Build and select the +DLL Debug and DLL Release entries for every one, this take a little time! Then +build them. + +The path names for wxWidgets are embedded within the Solution and Project +preferences, and will need changing if anything other than these default +locations are used. The first pass through the compiler will no doubt tell +you all that you need to know if there are problems. + +Once you have built the executables, you will need to copy the correct wxWidgets +files to the same location as the executables. For 32-bit systems these are +wxbase30u_vc_custom.dll, wxmsw30u_adv_vc_custom.dll, and +wxmsw30u_core_vc_custom.dll. On 64-bit systems you'll need +wxbase30u_vc_x64_custom.dll, wxmsw30u_adv_vc_x64_custom.dll, and +wxmsw30u_core_vc_x64_custom.dll + +If you are running in debug mode then the required wxWidgets files have the names +xxx30ud_xxxx instead. These can be found in the wxWidgets-3.0.4\lib\vc_dll +directory. + +It is also probable that you'll need to install a copy of the latest Visual C++ +run-time libraries from Microsoft, if you are not running the gateway software +on the same machine as the development/compilation was done on. You can find the +latest versions at https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads + + +## Linux + +You need to ensure that wxGTK is already installed on your machine. + +Debian, Ubuntu: +```sh +sudo apt install libwxgtk3.0-dev +``` + +Fedora, CentOS, RedHat: +```sh +sudo dnf install wxGTK3-devel +``` + +To install them from scratch, you need to get wxGTK from +. If you do a "make install" on it then they'll +be installed in the right places and nothing more needs to be done. + +To actually build the software, type "make" in the same directory as this file +and all should build without errors, there may be a warning or two though. Once +compiled log in as root or use the sudo command, and do "make install". + +You can optionally specify some make variables to alter the default behavior: + +| Parameter | Default | Description | +| --------- | --------- | --------------------------------- | +| BUILD | `debug` | `debug` or `release` | +| TARGET | _not set_ | when set to `opendv`, installs files in legacy locations | +| DATADIR | `/usr/share/ircddbgateway` | where AMBE voice and host lists are kept | +| LOGDIR | `/var/log` | location of log files | +| CONFDIR | `/etc` | location of configuration files | +| BINDIR | `/usr/bin` | program binaries installed here | +| DESTDIR | _not set_ | destination for staged build | + +### Example + +```sh +cd ircDDBGateway +make -j4 BUILD=release CONFDIR=/etc/dstar +sudo make install +``` + +This would build and install all the programs in this repo using 4 threads +(parallel build jobs), in release mode (no debug symbols) with a modified +configuration directory. + diff --git a/CHANGES.txt b/CHANGES.txt index 4f15778..edb04a7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -ircDDB Gateway - 20180509 +ircDDB Gateway - 20180627 ========================= 20101010 @@ -1476,3 +1476,15 @@ Added APRSTransmit program from F4FXL. Move to wxWidgets-3.0.x. UPdate to VS2017 on Windows for 32 and 64 bit compilation. Simplify the Linux build. + +20180627 +-------- + +Support the GPS data from the Kenwood TH-D74. + +2018xxxx +-------- + +Add support for external GPS input for mobile systems. +Add audio bypass processing for fast data mode. + diff --git a/Common/APRSCollector.cpp b/Common/APRSCollector.cpp index 1973427..40ff283 100644 --- a/Common/APRSCollector.cpp +++ b/Common/APRSCollector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010,2012,2013,2014 by Jonathan Naylor G4KLX + * Copyright (C) 2010,2012,2013,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 @@ -24,6 +24,9 @@ const unsigned int APRS_CSUM_LENGTH = 4U; const unsigned int APRS_DATA_LENGTH = 300U; const unsigned int SLOW_DATA_BLOCK_LENGTH = 6U; +const char APRS_OVERLAY = '\\'; +const char APRS_SYMBOL = 'K'; + CAPRSCollector::CAPRSCollector() : m_state(AS_NONE), m_ggaData(NULL), @@ -35,16 +38,14 @@ m_rmcValid(false), m_crcData(NULL), m_crcLength(0U), m_crcValid(false), -m_txtData(NULL), -m_txtLength(0U), -m_txtValid(false), m_buffer(NULL), -m_slowData(SS_FIRST) +m_slowData(SS_FIRST), +m_collector(), +m_callsign() { m_ggaData = new unsigned char[APRS_DATA_LENGTH]; m_rmcData = new unsigned char[APRS_DATA_LENGTH]; m_crcData = new unsigned char[APRS_DATA_LENGTH]; - m_txtData = new unsigned char[APRS_DATA_LENGTH]; m_buffer = new unsigned char[SLOW_DATA_BLOCK_LENGTH]; } @@ -53,10 +54,14 @@ CAPRSCollector::~CAPRSCollector() delete[] m_ggaData; delete[] m_rmcData; delete[] m_crcData; - delete[] m_txtData; delete[] m_buffer; } +void CAPRSCollector::writeHeader(const wxString& callsign) +{ + m_callsign = callsign; +} + bool CAPRSCollector::writeData(const unsigned char* data) { wxASSERT(data != NULL); @@ -77,11 +82,11 @@ bool CAPRSCollector::writeData(const unsigned char* data) break; } - // Is it GPS data, or are we collecting data already? - if ((m_buffer[0U] & SLOW_DATA_TYPE_MASK) != SLOW_DATA_TYPE_GPS) - return false; + // Is it GPS data? + if ((m_buffer[0U] & SLOW_DATA_TYPE_MASK) == SLOW_DATA_TYPE_GPS) + return addGPSData(m_buffer + 1U); - return addData(m_buffer + 1U); + return false; } void CAPRSCollector::reset() @@ -93,9 +98,9 @@ void CAPRSCollector::reset() m_rmcValid = false; m_crcLength = 0U; m_crcValid = false; - m_txtLength = 0U; - m_txtValid = false; m_slowData = SS_FIRST; + m_collector.Clear(); + m_callsign.Clear(); } void CAPRSCollector::sync() @@ -103,193 +108,175 @@ void CAPRSCollector::sync() m_slowData = SS_FIRST; } -bool CAPRSCollector::addData(const unsigned char* data) +bool CAPRSCollector::addGPSData(const unsigned char* data) { wxASSERT(data != NULL); - if (::memcmp(data, "$GPGG", 5U) == 0) { + m_collector.Append((char*)data, 5U); + + if (m_state == AS_GGA) { + addGGAData(); + return false; + } else if (m_state == AS_RMC) { + return addRMCData(); + } else if (m_state == AS_CRC) { + return addCRCData(); + } + + if (m_state != AS_GGA && m_collector.Find(wxT("$GPGGA")) != wxNOT_FOUND) { m_state = AS_GGA; m_ggaLength = 0U; m_ggaValid = false; m_rmcLength = 0U; m_rmcValid = false; - m_txtLength = 0U; - m_txtValid = false; - addGGAData(data); return false; - } else if (::memcmp(data, "$GPRM", 5U) == 0) { + } else if (m_state != AS_RMC && m_collector.Find(wxT("$GPRMC")) != wxNOT_FOUND) { m_state = AS_RMC; m_rmcLength = 0U; m_rmcValid = false; - m_txtLength = 0U; - m_txtValid = false; - addRMCData(data); return false; - } else if (::memcmp(data, "$$CRC", 5U) == 0) { + } else if (m_state != AS_CRC && m_collector.Find(wxT("$$CRC")) != wxNOT_FOUND) { m_state = AS_CRC; m_crcLength = 0U; m_crcValid = false; - return addCRCData(data); - } else if (m_state == AS_RMC && m_rmcLength == 0U) { - m_state = AS_TXT; - m_txtLength = 0U; - m_txtValid = false; - addTXTData(data); - return false; - } else if (m_state == AS_GGA) { - addGGAData(data); - return false; - } else if (m_state == AS_RMC) { - addRMCData(data); - return false; - } else if (m_state == AS_CRC) { - return addCRCData(data); - } else if (m_state == AS_TXT) { - return addTXTData(data); } return false; } -void CAPRSCollector::addGGAData(const unsigned char* data) +void CAPRSCollector::addGGAData() { - for (unsigned int i = 0U; i < 5U; i++) { - unsigned char c = data[i]; + int n2 = m_collector.Find(wxT('\x0A'), true); + if (n2 == wxNOT_FOUND) + return; - m_ggaData[m_ggaLength] = c & 0x7FU; + int n1 = m_collector.Find(wxT("$GPGGA")); + if (n1 == wxNOT_FOUND) + return; + + if (n2 < n1) + return; + + unsigned int len = n2 - n1; + + if (len >= APRS_DATA_LENGTH) { + m_ggaLength = 0U; + m_ggaValid = false; + m_state = AS_NONE; + return; + } + + m_ggaLength = 0U; + for (int i = n1; i <= n2; i++) { + m_ggaData[m_ggaLength] = m_collector.GetChar(i); + m_ggaData[m_ggaLength] &= 0x7FU; m_ggaLength++; - - if (m_ggaLength >= APRS_DATA_LENGTH) { - // CUtils::dump(wxT("Missed end of $GPGGA data"), m_ggaData, m_ggaLength); - m_ggaLength = 0U; - m_ggaValid = false; - m_state = AS_NONE; - return; - } - - if (c == 0x0AU) { - bool ret = checkXOR(m_ggaData + 1U, m_ggaLength - 1U); - if (ret) { - // CUtils::dump(wxT("$GPGGA Valid"), m_ggaData, m_ggaLength); - m_ggaValid = true; - m_state = AS_RMC; - return; - } else { - // CUtils::dump(wxT("$GPGGA Bad checksum"), m_ggaData, m_ggaLength); - m_ggaLength = 0U; - m_ggaValid = false; - m_state = AS_RMC; - return; - } - } } + + bool ret = checkXOR(m_ggaData + 1U, m_ggaLength - 1U); + if (ret) { + // CUtils::dump(wxT("$GPGGA Valid"), m_ggaData, m_ggaLength); + m_ggaValid = true; + m_state = AS_RMC; + } else { + // CUtils::dump(wxT("$GPGGA Bad checksum"), m_ggaData, m_ggaLength); + m_ggaLength = 0U; + m_ggaValid = false; + m_state = AS_RMC; + } + + m_collector = m_collector.Mid(n2); } -void CAPRSCollector::addRMCData(const unsigned char* data) +bool CAPRSCollector::addRMCData() { - for (unsigned int i = 0U; i < 5U; i++) { - unsigned char c = data[i]; + int n2 = m_collector.Find(wxT('\x0A'), true); + if (n2 == wxNOT_FOUND) + return false; - m_rmcData[m_rmcLength] = c & 0x7FU; + int n1 = m_collector.Find(wxT("$GPRMC")); + if (n1 == wxNOT_FOUND) + return false; + + if (n2 < n1) + return false; + + unsigned int len = n2 - n1; + + if (len >= APRS_DATA_LENGTH) { + m_rmcLength = 0U; + m_rmcValid = false; + m_state = AS_NONE; + return false; + } + + m_rmcLength = 0U; + for (int i = n1; i <= n2; i++) { + m_rmcData[m_rmcLength] = m_collector.GetChar(i); + m_rmcData[m_rmcLength] &= 0x7FU; m_rmcLength++; - - if (m_rmcLength >= APRS_DATA_LENGTH) { - // CUtils::dump(wxT("Missed end of $GPRMC data"), m_rmcData, m_rmcLength); - m_rmcLength = 0U; - m_rmcValid = false; - m_state = AS_NONE; - return; - } - - if (c == 0x0AU) { - bool ret = checkXOR(m_rmcData + 1U, m_rmcLength - 1U); - if (ret) { - // CUtils::dump(wxT("$GPRMC Valid"), m_rmcData, m_rmcLength); - m_rmcValid = true; - m_state = AS_TXT; - return; - } else { - // CUtils::dump(wxT("$GPRMC Bad checksum"), m_rmcData, m_rmcLength); - m_rmcLength = 0U; - m_rmcValid = false; - m_state = AS_TXT; - return; - } - } } + + bool ret = checkXOR(m_rmcData + 1U, m_rmcLength - 1U); + if (ret) { + // CUtils::dump(wxT("$GPRMC Valid"), m_rmcData, m_rmcLength); + m_rmcValid = true; + } else { + // CUtils::dump(wxT("$GPRMC Bad checksum"), m_rmcData, m_rmcLength); + m_rmcLength = 0U; + m_rmcValid = false; + } + + m_collector = m_collector.Mid(n2); + + m_state = AS_NONE; + + return true; } -bool CAPRSCollector::addCRCData(const unsigned char* data) +bool CAPRSCollector::addCRCData() { - for (unsigned int i = 0U; i < 5U; i++) { - unsigned char c = data[i]; + int n2 = m_collector.Find(wxT('\x0D'), true); + if (n2 == wxNOT_FOUND) + return false; - // m_crcData[m_crcLength] = c & 0x7FU; // XXX - m_crcData[m_crcLength] = c; + int n1 = m_collector.Find(wxT("$$CRC")); + if (n1 == wxNOT_FOUND) + return false; + + if (n2 < n1) + return false; + + unsigned int len = n2 - n1; + + if (len >= APRS_DATA_LENGTH) { + m_crcLength = 0U; + m_crcValid = false; + m_state = AS_NONE; + return false; + } + + m_crcLength = 0U; + for (int i = n1; i <= n2; i++) { + m_crcData[m_crcLength] = m_collector.GetChar(i); m_crcLength++; - - if (m_crcLength >= APRS_DATA_LENGTH) { - // CUtils::dump(wxT("Missed end of $$CRC data"), m_crcData, m_crcLength); - m_state = AS_NONE; - m_crcLength = 0U; - m_crcValid = false; - return false; - } - - if (c == 0x0DU) { - bool ret = checkCRC(m_crcData, m_crcLength); - if (ret) { - // CUtils::dump(wxT("$$CRC Valid"), m_crcData, m_crcLength); - m_state = AS_NONE; - m_crcValid = true; - return true; - } else { - // CUtils::dump(wxT("$$CRC Bad checksum"), m_crcData, m_crcLength); - m_state = AS_NONE; - m_crcLength = 0U; - m_crcValid = false; - return false; - } - } } - return false; -} - -bool CAPRSCollector::addTXTData(const unsigned char* data) -{ - for (unsigned int i = 0U; i < 5U; i++) { - unsigned char c = data[i]; - - m_txtData[m_txtLength] = c & 0x7FU; - m_txtLength++; - - if (m_txtLength >= APRS_DATA_LENGTH) { - // CUtils::dump(wxT("Missed end of TEXT data"), m_txtData, m_txtLength); - m_state = AS_NONE; - m_txtLength = 0U; - m_txtValid = false; - return false; - } - - if (c == 0x0AU) { - bool ret = checkXOR(m_txtData, m_txtLength); - if (ret) { - // CUtils::dump(wxT("TEXT Valid"), m_txtData, m_txtLength); - m_state = AS_NONE; - m_txtValid = true; - return true; - } else { - // CUtils::dump(wxT("TEXT Bad checksum"), m_txtData, m_txtLength); - m_state = AS_NONE; - m_txtLength = 0U; - m_txtValid = false; - return false; - } - } + bool ret = checkCRC(m_crcData, m_crcLength); + if (ret) { + // CUtils::dump(wxT("$$CRC Valid"), m_crcData, m_crcLength); + m_crcValid = true; + m_state = AS_NONE; + m_collector = m_collector.Mid(n2); + return true; + } else { + // CUtils::dump(wxT("$$CRC Bad checksum"), m_crcData, m_crcLength); + m_crcLength = 0U; + m_crcValid = false; + m_state = AS_NONE; + m_collector = m_collector.Mid(n2); + return false; } - - return false; } unsigned int CAPRSCollector::getData(unsigned char* data, unsigned int length) @@ -310,30 +297,26 @@ unsigned int CAPRSCollector::getData(unsigned char* data, unsigned int length) return len; } - // Have we got GGA and text data? - if (m_ggaValid && m_txtValid) { + // Have we got GGA data? + if (m_ggaValid) { unsigned int len = convertNMEA1(data, length); m_ggaLength = 0U; m_rmcLength = 0U; - m_txtLength = 0U; m_ggaValid = false; m_rmcValid = false; - m_txtValid = false; return len; } - // Have we got RMC and text data? - if (m_rmcValid && m_txtValid) { + // Have we got RMC data? + if (m_rmcValid) { unsigned int len = convertNMEA2(data, length); m_ggaLength = 0U; m_rmcLength = 0U; - m_txtLength = 0U; m_ggaValid = false; m_rmcValid = false; - m_txtValid = false; return len; } @@ -418,7 +401,7 @@ unsigned int CAPRSCollector::convertNMEA1(unsigned char* data, unsigned int) unsigned int nGGA = 0U; char* str = (char*)m_ggaData; - for (;;) { + while (nGGA < 20U) { char* p = mystrsep(&str, ",\r\n"); pGGA[nGGA++] = p; @@ -435,25 +418,9 @@ unsigned int CAPRSCollector::convertNMEA1(unsigned char* data, unsigned int) return 0U; char callsign[10U]; - ::memset(callsign, ' ', 10U); - ::strncpy(callsign, (char*)m_txtData, 7U); + dstarCallsignToAPRS(m_callsign, callsign); - // This can't fail! - char* p = ::strchr(callsign, ' '); - - if (m_txtData[6U] == ' ' && m_txtData[7U] != ' ') { - *p++ = '-'; - *p++ = m_txtData[7U]; - } else if (m_txtData[6U] != ' ' && m_txtData[7U] != ' ') { - *p++ = m_txtData[7U]; - } - - *p = '\0'; - - char symbol, overlay; - getSymbol(m_txtData + 9U, symbol, overlay); - - ::sprintf((char*)data, "%s>APDPRS,DSTAR*:!%.7s%s%c%.8s%s%c", callsign, pGGA[2U], pGGA[3U], overlay, pGGA[4U], pGGA[5U], symbol); + ::sprintf((char*)data, "%s>APDPRS,DSTAR*:!%.7s%s%c%.8s%s%c", callsign, pGGA[2U], pGGA[3U], APRS_OVERLAY, pGGA[4U], pGGA[5U], APRS_SYMBOL); // Get the bearing and speed from the RMC data if (m_rmcValid) { @@ -464,7 +431,7 @@ unsigned int CAPRSCollector::convertNMEA1(unsigned char* data, unsigned int) str = (char*)m_rmcData; for (;;) { - p = mystrsep(&str, ",\r\n"); + char* p = mystrsep(&str, ",\r\n"); pRMC[nRMC++] = p; if (p == NULL) @@ -480,21 +447,6 @@ unsigned int CAPRSCollector::convertNMEA1(unsigned char* data, unsigned int) } } - ::strcat((char*)data, " "); - - // Insert the message text - unsigned int j = ::strlen((char*)data); - for (unsigned int i = 13U; i < 29U; i++) { - unsigned char c = m_txtData[i]; - - if (c == '*') { - data[j] = '\0'; - break; - } - - data[j++] = c; - } - if (pGGA[9U] != NULL && ::strlen(pGGA[9U]) > 0U) { // Convert altitude from metres to feet int altitude = ::atoi(pGGA[9U]); @@ -512,7 +464,7 @@ unsigned int CAPRSCollector::convertNMEA2(unsigned char* data, unsigned int) unsigned int nRMC = 0U; char* str = (char*)m_rmcData; - for (;;) { + while (nRMC < 20U) { char* p = mystrsep(&str, ",\r\n"); pRMC[nRMC++] = p; @@ -529,25 +481,9 @@ unsigned int CAPRSCollector::convertNMEA2(unsigned char* data, unsigned int) return 0U; char callsign[10U]; - ::memset(callsign, ' ', 10U); - ::strncpy(callsign, (char*)m_txtData, 7U); + dstarCallsignToAPRS(m_callsign, callsign); - // This can't fail! - char* p = ::strchr(callsign, ' '); - - if (m_txtData[6U] == ' ' && m_txtData[7U] != ' ') { - *p++ = '-'; - *p++ = m_txtData[7U]; - } else if (m_txtData[6U] != ' ' && m_txtData[7U] != ' ') { - *p++ = m_txtData[7U]; - } - - *p = '\0'; - - char symbol, overlay; - getSymbol(m_txtData + 9U, symbol, overlay); - - ::sprintf((char*)data, "%s>APDPRS,DSTAR*:!%.7s%s%c%.8s%s%c", callsign, pRMC[3U], pRMC[4U], overlay, pRMC[5U], pRMC[6U], symbol); + ::sprintf((char*)data, "%s>APDPRS,DSTAR*:!%.7s%s%c%.8s%s%c", callsign, pRMC[3U], pRMC[4U], APRS_OVERLAY, pRMC[5U], pRMC[6U], APRS_SYMBOL); if (pRMC[7U] != NULL && pRMC[8U] != NULL && ::strlen(pRMC[7U]) > 0U && ::strlen(pRMC[8U]) > 0U) { int bearing = ::atoi(pRMC[8U]); @@ -556,90 +492,29 @@ unsigned int CAPRSCollector::convertNMEA2(unsigned char* data, unsigned int) ::sprintf((char*)data + ::strlen((char*)data), "%03d/%03d", bearing, speed); } - if (m_txtData[13U] != '*') - ::strcat((char*)data, " "); - - // Insert the message text - unsigned int j = ::strlen((char*)data); - for (unsigned int i = 13U; i < 29U; i++) { - unsigned char c = m_txtData[i]; - - if (c == '*') { - data[j] = '\0'; - break; - } - - data[j++] = c; - } - return ::strlen((char*)data); } -// Function taken from DPRSIntf.java from Pete Loveall AE5PL -void CAPRSCollector::getSymbol(const unsigned char* data, char& symbol, char& overlay) +void CAPRSCollector::dstarCallsignToAPRS(const wxString& dstarCallsign, char* aprsCallsign) const { - symbol = '.'; + wxASSERT(aprsCallsign != NULL); - if (data[3U] == ' ') { - int offset = -1; + wxString first = dstarCallsign.BeforeFirst(wxT(' ')); + wxString last = dstarCallsign.AfterLast(wxT(' ')); - switch (data[0U]) { - case 'B': - case 'O': - offset = -33; - break; - case 'P': - case 'A': - offset = 0; - break; - case 'M': - case 'N': - offset = -24; - break; - case 'H': - case 'D': - offset = 8; - break; - case 'L': - case 'S': - offset = 32; - break; - case 'J': - case 'Q': - offset = 74; - break; - default: - break; - } - - if (offset != -1 && ::isalnum(data[1U])) { - bool altIcons = false; - - // x is valid, lets get y - switch (data[0U]) { - case 'O': - case 'A': - case 'N': - case 'D': - case 'S': - case 'Q': - altIcons = true; - break; - } - - symbol = char(data[1U] + offset); - - overlay = '/'; - - if (altIcons) { - if (data[2] == ' ') - overlay = '\\'; - else if (::isalnum(data[2])) - overlay = data[2U]; - else - overlay = 0; - } - } + if (last.IsEmpty() || first.IsSameAs(last)) { + unsigned int n = 0U; + for (unsigned int i = 0U; i < first.Len(); i++) + aprsCallsign[n++] = first.GetChar(i); + aprsCallsign[n++] = '\0'; + } else { + unsigned int n = 0U; + for (unsigned int i = 0U; i < first.Len(); i++) + aprsCallsign[n++] = first.GetChar(i); + aprsCallsign[n++] = '-'; + for (unsigned int i = 0U; i < last.Len(); i++) + aprsCallsign[n++] = last.GetChar(i); + aprsCallsign[n++] = '\0'; } } diff --git a/Common/APRSCollector.h b/Common/APRSCollector.h index 8c79c1a..16557cf 100644 --- a/Common/APRSCollector.h +++ b/Common/APRSCollector.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010,2012 by Jonathan Naylor G4KLX + * Copyright (C) 2010,2012,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 @@ -27,8 +27,7 @@ enum APRS_STATE { AS_NONE, AS_GGA, AS_RMC, - AS_CRC, - AS_TXT + AS_CRC }; class CAPRSCollector { @@ -36,12 +35,14 @@ public: CAPRSCollector(); ~CAPRSCollector(); + void writeHeader(const wxString& callsign); + bool writeData(const unsigned char* data); - void sync(); - void reset(); + void sync(); + unsigned int getData(unsigned char* data, unsigned int length); private: @@ -55,17 +56,16 @@ private: unsigned char* m_crcData; unsigned int m_crcLength; bool m_crcValid; - unsigned char* m_txtData; - unsigned int m_txtLength; - bool m_txtValid; unsigned char* m_buffer; SLOWDATA_STATE m_slowData; + wxString m_collector; + wxString m_callsign; - bool addData(const unsigned char* data); - void addGGAData(const unsigned char* data); - void addRMCData(const unsigned char* data); - bool addCRCData(const unsigned char* data); - bool addTXTData(const unsigned char* data); + bool addGPSData(const unsigned char* data); + + void addGGAData(); + bool addRMCData(); + bool addCRCData(); bool checkXOR(const unsigned char* data, unsigned int length) const; unsigned char calcXOR(const unsigned char* buffer, unsigned int length) const; @@ -76,7 +76,7 @@ private: unsigned int convertNMEA1(unsigned char* data, unsigned int length); unsigned int convertNMEA2(unsigned char* data, unsigned int length); - void getSymbol(const unsigned char* data, char& symbol, char& overlay); + void dstarCallsignToAPRS(const wxString& dstarCallsign, char* aprsCallsign) const; char* mystrsep(char** sp, const char* sep) const; }; diff --git a/Common/APRSWriter.cpp b/Common/APRSWriter.cpp index ae5d6a0..3fab725 100644 --- a/Common/APRSWriter.cpp +++ b/Common/APRSWriter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2014,2018,2020 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 @@ -118,22 +118,29 @@ bool CAPRSEntry::isOK() } } -CAPRSWriter::CAPRSWriter(const wxString& hostname, unsigned int port, const wxString& gateway, const wxString& address) : -m_thread(NULL), -m_enabled(false), -m_idTimer(1000U, 20U * 60U), // 20 minutes +CAPRSWriter::CAPRSWriter(const wxString& address, unsigned int port, const wxString& gateway) : +m_idTimer(1000U), m_gateway(), -m_array() +m_array(), +m_aprsAddress(), +m_aprsPort(port), +m_aprsSocket() +#if defined(USE_GPSD) +,m_gpsdEnabled(false), +m_gpsdAddress(), +m_gpsdPort(), +m_gpsdData() +#endif { - wxASSERT(!hostname.IsEmpty()); + wxASSERT(!address.IsEmpty()); wxASSERT(port > 0U); wxASSERT(!gateway.IsEmpty()); - m_thread = new CAPRSWriterThread(gateway, address, hostname, port); - m_gateway = gateway; m_gateway.Truncate(LONG_CALLSIGN_LENGTH - 1U); m_gateway.Trim(); + + m_aprsAddress = CUDPReaderWriter::lookup(address); } CAPRSWriter::~CAPRSWriter() @@ -144,7 +151,7 @@ CAPRSWriter::~CAPRSWriter() m_array.clear(); } -void CAPRSWriter::setPort(const wxString& callsign, const wxString& band, double frequency, double offset, double range, double latitude, double longitude, double agl) +void CAPRSWriter::setPortFixed(const wxString& callsign, const wxString& band, double frequency, double offset, double range, double latitude, double longitude, double agl) { wxString temp = callsign; temp.resize(LONG_CALLSIGN_LENGTH - 1U, wxT(' ')); @@ -153,9 +160,64 @@ void CAPRSWriter::setPort(const wxString& callsign, const wxString& band, double m_array[temp] = new CAPRSEntry(callsign, band, frequency, offset, range, latitude, longitude, agl); } +void CAPRSWriter::setPortGPSD(const wxString& callsign, const wxString& band, double frequency, double offset, double range, const wxString& address, const wxString& port) +{ +#if defined(USE_GPSD) + wxASSERT(!address.IsEmpty()); + wxASSERT(!port.IsEmpty()); + + wxString temp = callsign; + temp.resize(LONG_CALLSIGN_LENGTH - 1U, wxT(' ')); + temp.Append(band); + + m_array[temp] = new CAPRSEntry(callsign, band, frequency, offset, range, 0.0, 0.0, 0.0); + + m_gpsdEnabled = true; + m_gpsdAddress = address; + m_gpsdPort = port; +#endif +} + bool CAPRSWriter::open() { - return m_thread->start(); +#if defined(USE_GPSD) + if (m_gpsdEnabled) { + int ret = ::gps_open(m_gpsdAddress.mb_str(), m_gpsdPort.mb_str(), &m_gpsdData); + if (ret != 0) { + wxLogError(wxT("Error when opening access to gpsd - %d - %s"), errno, ::gps_errstr(errno)); + return false; + } + + ::gps_stream(&m_gpsdData, WATCH_ENABLE | WATCH_JSON, NULL); + + wxLogMessage(wxT("Connected to GPSD")); + } +#endif + bool ret = m_aprsSocket.open(); + if (!ret) + return false; + + wxLogMessage(wxT("Opened connection to the APRS Gateway")); + + m_idTimer.setTimeout(60U); + m_idTimer.start(); + + return true; +} + +void CAPRSWriter::writeHeader(const wxString& callsign, const CHeaderData& header) +{ + CAPRSEntry* entry = m_array[callsign]; + if (entry == NULL) { + wxLogError(wxT("Cannot find the callsign \"%s\" in the APRS array"), callsign.c_str()); + return; + } + + entry->reset(); + + CAPRSCollector* collector = entry->getCollector(); + + collector->writeHeader(header.getMyCall1()); } void CAPRSWriter::writeData(const wxString& callsign, const CAMBEData& data) @@ -183,16 +245,6 @@ void CAPRSWriter::writeData(const wxString& callsign, const CAMBEData& data) if (!complete) return; - if (!m_enabled) { - collector->reset(); - return; - } - - if (!m_thread->isConnected()) { - collector->reset(); - return; - } - // Check the transmission timer bool ok = entry->isOK(); if (!ok) { @@ -223,67 +275,59 @@ void CAPRSWriter::writeData(const wxString& callsign, const CAMBEData& data) body = body.Left(n); wxString output; - output.Printf(wxT("%s,qAR,%s-%s:%s"), header.c_str(), entry->getCallsign().c_str(), entry->getBand().c_str(), body.c_str()); + output.Printf(wxT("%s,qAR,%s-%s:%s\r\n"), header.c_str(), entry->getCallsign().c_str(), entry->getBand().c_str(), body.c_str()); char ascii[500U]; ::memset(ascii, 0x00, 500U); for (unsigned int i = 0U; i < output.Len(); i++) ascii[i] = output.GetChar(i); - m_thread->write(ascii); + wxLogDebug(wxT("APRS ==> %s"), output.c_str()); + + m_aprsSocket.write((unsigned char*)ascii, (unsigned int)::strlen(ascii), m_aprsAddress, m_aprsPort); collector->reset(); } -void CAPRSWriter::reset(const wxString& callsign) -{ - CAPRSEntry* entry = m_array[callsign]; - if (entry == NULL) { - wxLogError(wxT("Cannot find the callsign \"%s\" in the APRS array"), callsign.c_str()); - return; - } - - entry->reset(); -} - -void CAPRSWriter::setEnabled(bool enabled) -{ - m_enabled = enabled; - - if (m_enabled) { - sendIdFrames(); - m_idTimer.start(); - } -} - void CAPRSWriter::clock(unsigned int ms) { m_idTimer.clock(ms); - if (m_idTimer.hasExpired()) { - sendIdFrames(); - m_idTimer.start(); - } +#if defined(USE_GPSD) + if (m_gpsdEnabled) { + if (m_idTimer.hasExpired()) { + sendIdFramesMobile(); + m_idTimer.start(); + } + } else { +#endif + if (m_idTimer.hasExpired()) { + sendIdFramesFixed(); + m_idTimer.setTimeout(20U * 60U); + m_idTimer.start(); + } +#if defined(USE_GPSD) + } +#endif for (CEntry_t::iterator it = m_array.begin(); it != m_array.end(); ++it) it->second->clock(ms); } -bool CAPRSWriter::isConnected() const -{ - return m_thread->isConnected(); -} - void CAPRSWriter::close() { - m_thread->stop(); + m_aprsSocket.close(); + +#if defined(USE_GPSD) + if (m_gpsdEnabled) { + ::gps_stream(&m_gpsdData, WATCH_DISABLE, NULL); + ::gps_close(&m_gpsdData); + } +#endif } -void CAPRSWriter::sendIdFrames() +void CAPRSWriter::sendIdFramesFixed() { - if (!m_thread->isConnected()) - return; - time_t now; ::time(&now); struct tm* tm = ::gmtime(&now); @@ -361,34 +405,196 @@ void CAPRSWriter::sendIdFrames() lon.Replace(wxT(","), wxT(".")); wxString output; - output.Printf(wxT("%s-S>APDG01,TCPIP*,qAC,%s-GS:;%-7s%-2s*%02d%02d%02dz%s%cD%s%caRNG%04.0lf %s %s"), + output.Printf(wxT("%s-S>APDG01,TCPIP*,qAC,%s-GS:;%-7s%-2s*%02d%02d%02dz%s%cD%s%caRNG%04.0lf/A=%06.0lf %s %s\r\n"), m_gateway.c_str(), m_gateway.c_str(), entry->getCallsign().c_str(), entry->getBand().c_str(), tm->tm_mday, tm->tm_hour, tm->tm_min, lat.c_str(), (entry->getLatitude() < 0.0F) ? wxT('S') : wxT('N'), lon.c_str(), (entry->getLongitude() < 0.0F) ? wxT('W') : wxT('E'), - entry->getRange() * 0.6214, band.c_str(), desc.c_str()); + entry->getRange() * 0.6214, entry->getAGL() * 3.28, band.c_str(), desc.c_str()); char ascii[300U]; ::memset(ascii, 0x00, 300U); for (unsigned int i = 0U; i < output.Len(); i++) ascii[i] = output.GetChar(i); - m_thread->write(ascii); + wxLogDebug(wxT("APRS ==> %s"), output.c_str()); + + m_aprsSocket.write((unsigned char*)ascii, (unsigned int)::strlen(ascii), m_aprsAddress, m_aprsPort); if (entry->getBand().Len() == 1U) { - output.Printf(wxT("%s-%s>APDG02,TCPIP*,qAC,%s-%sS:!%s%cD%s%c&RNG%04.0lf %s %s"), + output.Printf(wxT("%s-%s>APDG02,TCPIP*,qAC,%s-%sS:!%s%cD%s%c&RNG%04.0lf/A=%06.0lf %s %s\r\n"), entry->getCallsign().c_str(), entry->getBand().c_str(), entry->getCallsign().c_str(), entry->getBand().c_str(), lat.c_str(), (entry->getLatitude() < 0.0F) ? wxT('S') : wxT('N'), lon.c_str(), (entry->getLongitude() < 0.0F) ? wxT('W') : wxT('E'), - entry->getRange() * 0.6214, band.c_str(), desc.c_str()); + entry->getRange() * 0.6214, entry->getAGL() * 3.28, band.c_str(), desc.c_str()); ::memset(ascii, 0x00, 300U); for (unsigned int i = 0U; i < output.Len(); i++) ascii[i] = output.GetChar(i); - m_thread->write(ascii); + wxLogDebug(wxT("APRS ==> %s"), output.c_str()); + + m_aprsSocket.write((unsigned char*)ascii, (unsigned int)::strlen(ascii), m_aprsAddress, m_aprsPort); } } - - m_idTimer.start(); } + +#if defined(USE_GPSD) +void CAPRSWriter::sendIdFramesMobile() +{ + if (!m_gpsdEnabled) + return; + + if (!::gps_waiting(&m_gpsdData, 0)) + return; + + if (::gps_read(&m_gpsdData, NULL, 0) <= 0) + return; + + if (m_gpsdData.status != STATUS_FIX) + return; + + bool latlonSet = (m_gpsdData.set & LATLON_SET) == LATLON_SET; + bool altitudeSet = (m_gpsdData.set & ALTITUDE_SET) == ALTITUDE_SET; + bool velocitySet = (m_gpsdData.set & SPEED_SET) == SPEED_SET; + bool bearingSet = (m_gpsdData.set & TRACK_SET) == TRACK_SET; + + if (!latlonSet) + return; + + float rawLatitude = float(m_gpsdData.fix.latitude); + float rawLongitude = float(m_gpsdData.fix.longitude); + float rawAltitude = float(m_gpsdData.fix.altMSL); + float rawVelocity = float(m_gpsdData.fix.speed); + float rawBearing = float(m_gpsdData.fix.track); + + time_t now; + ::time(&now); + struct tm* tm = ::gmtime(&now); + + for (CEntry_t::iterator it = m_array.begin(); it != m_array.end(); ++it) { + CAPRSEntry* entry = it->second; + if (entry == NULL) + continue; + + wxString desc; + if (entry->getBand().Len() > 1U) { + if (entry->getFrequency() != 0.0) + desc.Printf(wxT("Data %.5lfMHz"), entry->getFrequency()); + else + desc = wxT("Data"); + } else { + if (entry->getFrequency() != 0.0) + desc.Printf(wxT("Voice %.5lfMHz %c%.4lfMHz"), + entry->getFrequency(), + entry->getOffset() < 0.0 ? wxT('-') : wxT('+'), + ::fabs(entry->getOffset())); + else + desc = wxT("Voice"); + } + + wxString band; + if (entry->getFrequency() >= 1200.0) + band = wxT("1.2"); + else if (entry->getFrequency() >= 420.0) + band = wxT("440"); + else if (entry->getFrequency() >= 144.0) + band = wxT("2m"); + else if (entry->getFrequency() >= 50.0) + band = wxT("6m"); + else if (entry->getFrequency() >= 28.0) + band = wxT("10m"); + + double tempLat = ::fabs(rawLatitude); + double tempLong = ::fabs(rawLongitude); + + double latitude = ::floor(tempLat); + double longitude = ::floor(tempLong); + + latitude = (tempLat - latitude) * 60.0 + latitude * 100.0; + longitude = (tempLong - longitude) * 60.0 + longitude * 100.0; + + wxString lat; + if (latitude >= 1000.0F) + lat.Printf(wxT("%.2lf"), latitude); + else if (latitude >= 100.0F) + lat.Printf(wxT("0%.2lf"), latitude); + else if (latitude >= 10.0F) + lat.Printf(wxT("00%.2lf"), latitude); + else + lat.Printf(wxT("000%.2lf"), latitude); + + wxString lon; + if (longitude >= 10000.0F) + lon.Printf(wxT("%.2lf"), longitude); + else if (longitude >= 1000.0F) + lon.Printf(wxT("0%.2lf"), longitude); + else if (longitude >= 100.0F) + lon.Printf(wxT("00%.2lf"), longitude); + else if (longitude >= 10.0F) + lon.Printf(wxT("000%.2lf"), longitude); + else + lon.Printf(wxT("0000%.2lf"), longitude); + + // Convert commas to periods in the latitude and longitude + lat.Replace(wxT(","), wxT(".")); + lon.Replace(wxT(","), wxT(".")); + + wxString output1; + output1.Printf(wxT("%s-S>APDG01,TCPIP*,qAC,%s-GS:;%-7s%-2s*%02d%02d%02dz%s%cD%s%ca/A=%06.0lf"), + m_gateway.c_str(), m_gateway.c_str(), entry->getCallsign().c_str(), entry->getBand().c_str(), + tm->tm_mday, tm->tm_hour, tm->tm_min, + lat.c_str(), (rawLatitude < 0.0) ? wxT('S') : wxT('N'), + lon.c_str(), (rawLongitude < 0.0) ? wxT('W') : wxT('E'), + rawAltitude * 3.28); + + wxString output2; + if (bearingSet && velocitySet) + output2.Printf(wxT("%03.0lf/%03.0lf"), rawBearing, rawVelocity * 0.539957F); + + wxString output3; + output3.Printf(wxT("RNG%04.0lf %s %s\r\n"), entry->getRange() * 0.6214, band.c_str(), desc.c_str()); + + char ascii[300U]; + ::memset(ascii, 0x00, 300U); + unsigned int n = 0U; + for (unsigned int i = 0U; i < output1.Len(); i++, n++) + ascii[n] = output1.GetChar(i); + for (unsigned int i = 0U; i < output2.Len(); i++, n++) + ascii[n] = output2.GetChar(i); + for (unsigned int i = 0U; i < output3.Len(); i++, n++) + ascii[n] = output3.GetChar(i); + + wxLogDebug(wxT("APRS ==> %s%s%s"), output1.c_str(), output2.c_str(), output3.c_str()); + + m_aprsSocket.write((unsigned char*)ascii, (unsigned int)::strlen(ascii), m_aprsAddress, m_aprsPort); + + if (entry->getBand().Len() == 1U) { + if (altitudeSet) + output1.Printf(wxT("%s-%s>APDG02,TCPIP*,qAC,%s-%sS:!%s%cD%s%c&/A=%06.0lf"), + entry->getCallsign().c_str(), entry->getBand().c_str(), entry->getCallsign().c_str(), entry->getBand().c_str(), + lat.c_str(), (rawLatitude < 0.0) ? wxT('S') : wxT('N'), + lon.c_str(), (rawLongitude < 0.0) ? wxT('W') : wxT('E'), + rawAltitude * 3.28); + else + output1.Printf(wxT("%s-%s>APDG02,TCPIP*,qAC,%s-%sS:!%s%cD%s%c&"), + entry->getCallsign().c_str(), entry->getBand().c_str(), entry->getCallsign().c_str(), entry->getBand().c_str(), + lat.c_str(), (rawLatitude < 0.0) ? wxT('S') : wxT('N'), + lon.c_str(), (rawLongitude < 0.0) ? wxT('W') : wxT('E')); + + ::memset(ascii, 0x00, 300U); + unsigned int n = 0U; + for (unsigned int i = 0U; i < output1.Len(); i++, n++) + ascii[n] = output1.GetChar(i); + for (unsigned int i = 0U; i < output2.Len(); i++, n++) + ascii[n] = output2.GetChar(i); + for (unsigned int i = 0U; i < output3.Len(); i++, n++) + ascii[n] = output3.GetChar(i); + + wxLogDebug(wxT("APRS ==> %s%s%s"), output1.c_str(), output2.c_str(), output3.c_str()); + + m_aprsSocket.write((unsigned char*)ascii, (unsigned int)::strlen(ascii), m_aprsAddress, m_aprsPort); + } + } +} +#endif diff --git a/Common/APRSWriter.h b/Common/APRSWriter.h index 8eb1bf6..b4d48c3 100644 --- a/Common/APRSWriter.h +++ b/Common/APRSWriter.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010,2011,2012 by Jonathan Naylor G4KLX + * Copyright (C) 2010,2011,2012,2018,2020 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 @@ -19,13 +19,18 @@ #ifndef APRSWriter_H #define APRSWriter_H -#include "APRSWriterThread.h" +#include "UDPReaderWriter.h" #include "APRSCollector.h" #include "DStarDefines.h" +#include "HeaderData.h" #include "AMBEData.h" #include "Timer.h" #include "Defs.h" +#if defined(USE_GPSD) +#include +#endif + #include class CAPRSEntry { @@ -66,33 +71,40 @@ WX_DECLARE_STRING_HASH_MAP(CAPRSEntry*, CEntry_t); class CAPRSWriter { public: - CAPRSWriter(const wxString& hostname, unsigned int port, const wxString& gateway, const wxString& address); + CAPRSWriter(const wxString& address, unsigned int port, const wxString& gateway); ~CAPRSWriter(); bool open(); - void setPort(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 setPortGPSD(const wxString& callsign, const wxString& band, double frequency, double offset, double range, const wxString& address, const wxString& port); + + void writeHeader(const wxString& callsign, const CHeaderData& header); void writeData(const wxString& callsign, const CAMBEData& data); - void reset(const wxString& callsign); - - void setEnabled(bool enable); - - bool isConnected() const; - void clock(unsigned int ms); void close(); private: - CAPRSWriterThread* m_thread; - bool m_enabled; CTimer m_idTimer; wxString m_gateway; CEntry_t m_array; + in_addr m_aprsAddress; + unsigned int m_aprsPort; + CUDPReaderWriter m_aprsSocket; +#if defined(USE_GPSD) + bool m_gpsdEnabled; + wxString m_gpsdAddress; + wxString m_gpsdPort; + struct gps_data_t m_gpsdData; +#endif - void sendIdFrames(); + void sendIdFramesFixed(); + void sendIdFramesMobile(); }; #endif + diff --git a/Common/APRSWriterThread.cpp b/Common/APRSWriterThread.cpp deleted file mode 100644 index dfaf250..0000000 --- a/Common/APRSWriterThread.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (C) 2010-2014 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "APRSWriterThread.h" -#include "DStarDefines.h" -#include "Utils.h" -#include "Defs.h" - -// #define DUMP_TX - -const unsigned int APRS_TIMEOUT = 10U; - -CAPRSWriterThread::CAPRSWriterThread(const wxString& callsign, const wxString& address, const wxString& hostname, unsigned int port) : -wxThread(wxTHREAD_JOINABLE), -m_username(callsign), -m_ssid(callsign), -m_socket(hostname, port, address), -m_queue(20U), -m_exit(false), -m_connected(false), -m_APRSReadCallback(NULL), -m_filter(wxT("")), -m_clientName(wxT("ircDDBGateway")) -{ - wxASSERT(!callsign.IsEmpty()); - wxASSERT(!hostname.IsEmpty()); - wxASSERT(port > 0U); - - m_username.SetChar(LONG_CALLSIGN_LENGTH - 1U, wxT(' ')); - m_username.Trim(); - m_username.MakeUpper(); - - m_ssid = m_ssid.SubString(LONG_CALLSIGN_LENGTH - 1U, 1); -} - -CAPRSWriterThread::CAPRSWriterThread(const wxString& callsign, const wxString& address, const wxString& hostname, unsigned int port, const wxString& filter, const wxString& clientName) : -wxThread(wxTHREAD_JOINABLE), -m_username(callsign), -m_ssid(callsign), -m_socket(hostname, port, address), -m_queue(20U), -m_exit(false), -m_connected(false), -m_APRSReadCallback(NULL), -m_filter(filter), -m_clientName(clientName) -{ - wxASSERT(!callsign.IsEmpty()); - wxASSERT(!hostname.IsEmpty()); - wxASSERT(port > 0U); - - m_username.SetChar(LONG_CALLSIGN_LENGTH - 1U, wxT(' ')); - m_username.Trim(); - m_username.MakeUpper(); - - m_ssid = m_ssid.SubString(LONG_CALLSIGN_LENGTH - 1U, 1); -} - -CAPRSWriterThread::~CAPRSWriterThread() -{ - m_username.Clear(); -} - -bool CAPRSWriterThread::start() -{ - Create(); - Run(); - - return true; -} - -void* CAPRSWriterThread::Entry() -{ - wxLogMessage(wxT("Starting the APRS Writer thread")); - - m_connected = connect(); - - try { - while (!m_exit) { - if (!m_connected) { - m_connected = connect(); - - if (!m_connected){ - wxLogError(wxT("Reconnect attempt to the APRS server has failed")); - Sleep(10000UL); // 10 secs - } - } - - if (m_connected) { - if(!m_queue.isEmpty()){ - char* p = m_queue.getData(); - - wxString text(p, wxConvLocal); - wxLogMessage(wxT("APRS ==> %s"), text.c_str()); - - ::strcat(p, "\r\n"); - - bool ret = m_socket.write((unsigned char*)p, ::strlen(p)); - if (!ret) { - m_connected = false; - m_socket.close(); - wxLogError(wxT("Connection to the APRS thread has failed")); - } - - delete[] p; - } - { - wxString line; - int length = m_socket.readLine(line, APRS_TIMEOUT); - - /*if (length == 0) - wxLogWarning(wxT("No response from the APRS server after %u seconds"), APRS_TIMEOUT);*/ - - if (length < 0) { - m_connected = false; - m_socket.close(); - wxLogError(wxT("Error when reading from the APRS server")); - } - - if(length > 0 && line.GetChar(0) != '#'//check if we have something and if that something is an APRS frame - && m_APRSReadCallback != NULL)//do we have someone wanting an APRS Frame? - { - //wxLogMessage(wxT("Received APRS Frame : ") + line); - m_APRSReadCallback(wxString(line)); - } - } - - } - } - - if (m_connected) - m_socket.close(); - - while (!m_queue.isEmpty()) { - char* p = m_queue.getData(); - delete[] p; - } - } - catch (std::exception& e) { - wxString message(e.what(), wxConvLocal); - wxLogError(wxT("Exception raised in the APRS Writer thread - \"%s\""), message.c_str()); - } - catch (...) { - wxLogError(wxT("Unknown exception raised in the APRS Writer thread")); - } - - wxLogMessage(wxT("Stopping the APRS Writer thread")); - - return NULL; -} - -void CAPRSWriterThread::setReadAPRSCallback(ReadAPRSFrameCallback cb) -{ - m_APRSReadCallback = cb; -} - -void CAPRSWriterThread::write(const char* data) -{ - wxASSERT(data != NULL); - - if (!m_connected) - return; - - unsigned int len = ::strlen(data); - - char* p = new char[len + 5U]; - ::strcpy(p, data); - - m_queue.addData(p); -} - -bool CAPRSWriterThread::isConnected() const -{ - return m_connected; -} - -void CAPRSWriterThread::stop() -{ - m_exit = true; - - Wait(); -} - -bool CAPRSWriterThread::connect() -{ - unsigned int password = getAPRSPassword(m_username); - - bool ret = m_socket.open(); - if (!ret) - return false; - - //wait for lgin banner - int length; - wxString serverResponse(wxT("")); - length = m_socket.readLine(serverResponse, APRS_TIMEOUT); - if (length == 0) { - wxLogError(wxT("No reply from the APRS server after %u seconds"), APRS_TIMEOUT); - m_socket.close(); - return false; - } - wxLogMessage(wxT("Received login banner : ") + serverResponse); - - wxString filter(m_filter); - if (filter.Length() > 0) filter.Prepend(wxT(" filter ")); - wxString connectString = wxString::Format(wxT("user %s-%s pass %u vers %s%s\n"), m_username.c_str(), m_ssid.c_str(), password, - (m_clientName.Length() ? m_clientName : wxT("ircDDBGateway")).c_str(), - filter.c_str()); - //wxLogMessage(wxT("Connect String : ") + connectString); - ret = m_socket.writeLine(connectString); - if (!ret) { - m_socket.close(); - return false; - } - - - length = m_socket.readLine(serverResponse, APRS_TIMEOUT); - if (length == 0) { - wxLogError(wxT("No reply from the APRS server after %u seconds"), APRS_TIMEOUT); - m_socket.close(); - return false; - } - if (length < 0) { - wxLogError(wxT("Error when reading from the APRS server")); - m_socket.close(); - return false; - } - - wxLogMessage(wxT("Response from APRS server: ") + serverResponse); - - wxLogMessage(wxT("Connected to the APRS server")); - - return true; -} - -unsigned int CAPRSWriterThread::getAPRSPassword(wxString callsign) const -{ - unsigned int len = callsign.Length(); - - wxUint16 hash = 0x73E2U; - - for (unsigned int i = 0U; i < len; i += 2U) { - hash ^= (char)callsign.GetChar(i) << 8; - if(i + 1 < len) - hash ^= (char)callsign.GetChar(i + 1); - } - - return hash & 0x7FFFU; -} diff --git a/Common/APRSWriterThread.h b/Common/APRSWriterThread.h deleted file mode 100644 index 1e31254..0000000 --- a/Common/APRSWriterThread.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2010,2011,2012 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef APRSWriterThread_H -#define APRSWriterThread_H - -#include "TCPReaderWriterClient.h" -#include "RingBuffer.h" - -#include -typedef void (*ReadAPRSFrameCallback)(const wxString&); - -class CAPRSWriterThread : public wxThread { -public: - CAPRSWriterThread(const wxString& callsign, const wxString& address, const wxString& hostname, unsigned int port); - CAPRSWriterThread(const wxString& callsign, const wxString& address, const wxString& hostname, unsigned int port, const wxString& filter, const wxString& clientName); - virtual ~CAPRSWriterThread(); - - virtual bool start(); - - virtual bool isConnected() const; - - virtual void write(const char* data); - - virtual void* Entry(); - - virtual void stop(); - - void setReadAPRSCallback(ReadAPRSFrameCallback cb); - -private: - wxString m_username; - wxString m_ssid; - CTCPReaderWriterClient m_socket; - CRingBuffer m_queue; - bool m_exit; - bool m_connected; - ReadAPRSFrameCallback m_APRSReadCallback; - wxString m_filter; - wxString m_clientName; - - bool connect(); - unsigned int getAPRSPassword(wxString username) const; -}; - -#endif diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index bdbcfc3..e4a94e4 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -22,29 +22,29 @@ {E793CB8E-2AC9-431A-BBFC-3F52537BB3CF} Common Win32Proj - 10.0.16299.0 + 10.0 StaticLibrary - v141 + v142 Unicode true StaticLibrary - v141 + v142 Unicode true StaticLibrary - v141 + v142 Unicode StaticLibrary - v141 + v142 Unicode @@ -77,6 +77,10 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) + + + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) @@ -150,7 +154,6 @@ - @@ -189,6 +192,7 @@ + @@ -218,7 +222,6 @@ - @@ -260,6 +263,7 @@ + diff --git a/Common/Common.vcxproj.filters b/Common/Common.vcxproj.filters index 8365240..3dbcf6d 100644 --- a/Common/Common.vcxproj.filters +++ b/Common/Common.vcxproj.filters @@ -23,9 +23,6 @@ Source Files - - Source Files - Source Files @@ -53,6 +50,9 @@ Source Files + + Source Files + Source Files @@ -209,6 +209,9 @@ Source Files + + Source Files + @@ -223,9 +226,6 @@ Header Files - - Header Files - Header Files @@ -256,6 +256,9 @@ Header Files + + Header Files + Header Files @@ -433,5 +436,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/Common/ConsoleLogger.cpp b/Common/ConsoleLogger.cpp new file mode 100644 index 0000000..acd4269 --- /dev/null +++ b/Common/ConsoleLogger.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2002,2003,2009,2011,2012,2019 by Jonathan Naylor G4KLX + * Copyright (C) 2020 by Adam Kolakowski SQ7LRX + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "ConsoleLogger.h" + +const char CConsoleLogger::S_LEVELS[] = "FEWMMIDTPU"; + +CConsoleLogger::CConsoleLogger() : +wxLog(), +m_stdout(new wxMessageOutputStderr(stdout)), +m_stderr(new wxMessageOutputStderr(stderr)) +{ +} + +CConsoleLogger::~CConsoleLogger() +{ +} + +void CConsoleLogger::DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info) +{ + if (level > 9) + level = 9; + + if (level <= wxLOG_Error) { + m_stderr->Printf(wxT("%c: %s\n"), CConsoleLogger::S_LEVELS[level], msg.c_str()); + } else { + m_stdout->Printf(wxT("%c: %s\n"), CConsoleLogger::S_LEVELS[level], msg.c_str()); + } + + if (level == wxLOG_FatalError) + ::abort(); +} diff --git a/Common/ConsoleLogger.h b/Common/ConsoleLogger.h new file mode 100644 index 0000000..b040bf9 --- /dev/null +++ b/Common/ConsoleLogger.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2002,2003,2009,2011,2012,2019 by Jonathan Naylor G4KLX + * Copyright (C) 2020 by Adam Kolakowski SQ7LRX + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef ConsoleLogger_H +#define ConsoleLogger_H + +#include + + +class CConsoleLogger : public wxLog { +public: + CConsoleLogger(); + virtual ~CConsoleLogger(); + + virtual void DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info); + +private: + const static char S_LEVELS[]; + + wxMessageOutput *m_stdout; + wxMessageOutput *m_stderr; +}; + +#endif + diff --git a/Common/DCSHandler.cpp b/Common/DCSHandler.cpp index 85888d2..2016805 100644 --- a/Common/DCSHandler.cpp +++ b/Common/DCSHandler.cpp @@ -39,6 +39,8 @@ CCallsignList* CDCSHandler::m_blackList = NULL; CDCSHandler::CDCSHandler(IReflectorCallback* handler, const wxString& reflector, const wxString& repeater, CDCSProtocolHandler* protoHandler, const in_addr& address, unsigned int port, DIRECTION direction) : m_reflector(reflector.Clone()), +m_xlxReflector(), +m_isXlx(false), m_repeater(repeater.Clone()), m_handler(protoHandler), m_yourAddress(address), @@ -78,6 +80,11 @@ m_rptCall2() m_linkState = DCS_LINKED; } else { m_linkState = DCS_LINKING; + m_isXlx = m_reflector.StartsWith(wxT("XLX")); + if (m_isXlx) { + m_xlxReflector = m_reflector.Clone(); + m_reflector = wxT("DCS") + m_reflector.Right(m_reflector.length() - 3); + } m_tryTimer.start(); } } @@ -162,10 +169,10 @@ void CDCSHandler::getInfo(IReflectorCallback* handler, CRemoteRepeaterData& data if (reflector->m_destination == handler) { if (reflector->m_direction == DIR_INCOMING && reflector->m_repeater.IsEmpty()) { if (reflector->m_linkState != DCS_UNLINKING) - data.addLink(reflector->m_reflector, PROTO_DCS, reflector->m_linkState == DCS_LINKED, DIR_INCOMING, true); + data.addLink(GET_DISP_REFLECTOR(reflector), PROTO_DCS, reflector->m_linkState == DCS_LINKED, DIR_INCOMING, true); } else { if (reflector->m_linkState != DCS_UNLINKING) - data.addLink(reflector->m_reflector, PROTO_DCS, reflector->m_linkState == DCS_LINKED, reflector->m_direction, false); + data.addLink(GET_DISP_REFLECTOR(reflector), PROTO_DCS, reflector->m_linkState == DCS_LINKED, reflector->m_direction, false); } } } @@ -634,10 +641,10 @@ bool CDCSHandler::processInt(CConnectData& connect, CD_TYPE type) return false; if (m_linkState == DCS_LINKING) { - wxLogMessage(wxT("DCS ACK message received from %s"), m_reflector.c_str()); + wxLogMessage(wxT("DCS ACK message received from %s"), GET_DISP_REFLECTOR(this).c_str()); if (m_direction == DIR_OUTGOING && m_destination != NULL) - m_destination->linkUp(DP_DCS, m_reflector); + m_destination->linkUp(DP_DCS, GET_DISP_REFLECTOR(this)); m_tryTimer.stop(); m_stateChange = true; @@ -651,16 +658,16 @@ bool CDCSHandler::processInt(CConnectData& connect, CD_TYPE type) return false; if (m_linkState == DCS_LINKING) { - wxLogMessage(wxT("DCS NAK message received from %s"), m_reflector.c_str()); + wxLogMessage(wxT("DCS NAK message received from %s"), GET_DISP_REFLECTOR(this).c_str()); if (m_direction == DIR_OUTGOING && m_destination != NULL) - m_destination->linkRefused(DP_DCS, m_reflector); + m_destination->linkRefused(DP_DCS, GET_DISP_REFLECTOR(this)); return true; } if (m_linkState == DCS_UNLINKING) { - wxLogMessage(wxT("DCS NAK message received from %s"), m_reflector.c_str()); + wxLogMessage(wxT("DCS NAK message received from %s"), GET_DISP_REFLECTOR(this).c_str()); if (m_direction == DIR_OUTGOING && m_destination != NULL) m_destination->linkFailed(DP_DCS, m_reflector, false); @@ -675,10 +682,10 @@ bool CDCSHandler::processInt(CConnectData& connect, CD_TYPE type) return false; if (m_linkState == DCS_LINKED) { - wxLogMessage(wxT("DCS disconnect message received from %s"), m_reflector.c_str()); + wxLogMessage(wxT("DCS disconnect message received from %s"), GET_DISP_REFLECTOR(this).c_str()); if (m_direction == DIR_OUTGOING && m_destination != NULL) - m_destination->linkFailed(DP_DCS, m_reflector, false); + m_destination->linkFailed(DP_DCS, GET_DISP_REFLECTOR(this), false); m_stateChange = true; } @@ -706,20 +713,20 @@ bool CDCSHandler::clockInt(unsigned int ms) switch (m_linkState) { case DCS_LINKING: - wxLogMessage(wxT("DCS link to %s has failed to connect"), m_reflector.c_str()); + wxLogMessage(wxT("DCS link to %s has failed to connect"), GET_DISP_REFLECTOR(this).c_str()); break; case DCS_LINKED: - wxLogMessage(wxT("DCS link to %s has failed (poll inactivity)"), m_reflector.c_str()); + wxLogMessage(wxT("DCS link to %s has failed (poll inactivity)"), GET_DISP_REFLECTOR(this).c_str()); break; case DCS_UNLINKING: - wxLogMessage(wxT("DCS link to %s has failed to disconnect cleanly"), m_reflector.c_str()); + wxLogMessage(wxT("DCS link to %s has failed to disconnect cleanly"), GET_DISP_REFLECTOR(this).c_str()); break; default: break; } if (m_direction == DIR_OUTGOING) { - bool reconnect = m_destination->linkFailed(DP_DCS, m_reflector, true); + bool reconnect = m_destination->linkFailed(DP_DCS, GET_DISP_REFLECTOR(this), true); if (reconnect) { CConnectData reply(m_gatewayType, m_repeater, m_reflector, CT_LINK1, m_yourAddress, m_yourPort); m_handler->writeConnect(reply); @@ -844,7 +851,7 @@ void CDCSHandler::writeStatus(wxFFile& file) wxString text; text.Printf(wxT("%04d-%02d-%02d %02d:%02d:%02d: DCS link - Type: Repeater Rptr: %s Refl: %s Dir: Outgoing\n"), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, - reflector->m_repeater.c_str(), reflector->m_reflector.c_str()); + reflector->m_repeater.c_str(), GET_DISP_REFLECTOR(reflector).c_str()); file.Write(text); } break; @@ -854,7 +861,7 @@ void CDCSHandler::writeStatus(wxFFile& file) wxString text; text.Printf(wxT("%04d-%02d-%02d %02d:%02d:%02d: DCS link - Type: Repeater Rptr: %s Refl: %s Dir: Incoming\n"), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, - reflector->m_repeater.c_str(), reflector->m_reflector.c_str()); + reflector->m_repeater.c_str(), GET_DISP_REFLECTOR(reflector).c_str()); file.Write(text); } break; diff --git a/Common/DCSHandler.h b/Common/DCSHandler.h index d54334a..8cd1caa 100644 --- a/Common/DCSHandler.h +++ b/Common/DCSHandler.h @@ -39,6 +39,8 @@ #include #include +#define GET_DISP_REFLECTOR(refl) (refl->m_isXlx ? refl->m_xlxReflector : refl->m_reflector) + enum DCS_STATE { DCS_LINKING, DCS_LINKED, @@ -109,6 +111,8 @@ private: static CCallsignList* m_blackList; wxString m_reflector; + wxString m_xlxReflector; + bool m_isXlx; wxString m_repeater; CDCSProtocolHandler* m_handler; in_addr m_yourAddress; diff --git a/Common/DDHandler.cpp b/Common/DDHandler.cpp index cab79e6..faa9a40 100644 --- a/Common/DDHandler.cpp +++ b/Common/DDHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011,2012,2013 by Jonathan Naylor G4KLX + * Copyright (C) 2011,2012,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 @@ -22,8 +22,7 @@ #include -#if !defined(WIN32) -// XXX Check these +#if defined(__linux__) #include #include #include @@ -103,7 +102,7 @@ void CDDHandler::initialise(unsigned int maxRoutes, const wxString& name) // Add a dummy entry for "DX-Cluster" multicast m_list[2] = new CEthernet(DX_MULTICAST_ADDRESS, wxT("CQCQCQ ")); -#if !defined(WIN32) +#if defined(__linux__) m_fd = ::open("/dev/net/tun", O_RDWR); if (m_fd < 0) { wxLogError(wxT("Cannot open /dev/net/tun")); @@ -238,7 +237,7 @@ void CDDHandler::process(CDDData& data) } } -#if !defined(WIN32) +#if defined(__linux__) unsigned int length = data.getEthernetFrame(m_buffer, BUFFER_LENGTH); ssize_t len = ::write(m_fd, (char*)m_buffer, length); @@ -253,7 +252,7 @@ CDDData* CDDHandler::read() if (m_maxRoutes == 0U) return NULL; -#if defined(WIN32) +#if defined(__WINDOWS__) return NULL; #else // Check that the read() won't block diff --git a/Common/DPlusAuthenticator.cpp b/Common/DPlusAuthenticator.cpp index 7c124a4..0576edd 100644 --- a/Common/DPlusAuthenticator.cpp +++ b/Common/DPlusAuthenticator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2019 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 @@ -22,12 +22,9 @@ #include "Utils.h" #include "Defs.h" -const wxString OPENDSTAR_HOSTNAME = wxT("opendstar.org"); +const wxString OPENDSTAR_HOSTNAME = wxT("auth.dstargateway.org"); const unsigned int OPENDSTAR_PORT = 20001U; -const wxString DUTCHSTAR_HOSTNAME = wxT("dpns.dutch-star.eu"); -const unsigned int DUTCHSTAR_PORT = 20001U; - const unsigned int TCP_TIMEOUT = 10U; CDPlusAuthenticator::CDPlusAuthenticator(const wxString& loginCallsign, const wxString& gatewayCallsign, const wxString& address, CCacheManager* cache) : @@ -37,7 +34,6 @@ m_gatewayCallsign(gatewayCallsign), m_address(address), m_cache(cache), m_timer(1U, 6U * 3600U), // 6 hours -m_pollTimer(1U, 60U), // 1 minute m_killed(false) { wxASSERT(!loginCallsign.IsEmpty()); @@ -68,28 +64,19 @@ void* CDPlusAuthenticator::Entry() wxLogMessage(wxT("Starting the D-Plus Authenticator thread")); authenticate(m_loginCallsign, OPENDSTAR_HOSTNAME, OPENDSTAR_PORT, '2', true); - authenticate(m_gatewayCallsign, DUTCHSTAR_HOSTNAME, DUTCHSTAR_PORT, 'K', false); m_timer.start(); - m_pollTimer.start(); try { while (!m_killed) { - if (m_pollTimer.hasExpired()) { - poll(m_gatewayCallsign, DUTCHSTAR_HOSTNAME, DUTCHSTAR_PORT, 'K'); - m_pollTimer.start(); - } - if (m_timer.hasExpired()) { authenticate(m_loginCallsign, OPENDSTAR_HOSTNAME, OPENDSTAR_PORT, '2', true); - authenticate(m_gatewayCallsign, DUTCHSTAR_HOSTNAME, DUTCHSTAR_PORT, 'K', false); m_timer.start(); } Sleep(1000UL); m_timer.clock(); - m_pollTimer.clock(); } } catch (std::exception& e) { diff --git a/Common/DPlusAuthenticator.h b/Common/DPlusAuthenticator.h index 606ce12..03faead 100644 --- a/Common/DPlusAuthenticator.h +++ b/Common/DPlusAuthenticator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2013,2019 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 @@ -48,7 +48,6 @@ private: wxString m_address; CCacheManager* m_cache; CTimer m_timer; - CTimer m_pollTimer; bool m_killed; bool poll(const wxString& callsign, const wxString& hostname, unsigned int port, unsigned char id); diff --git a/Common/DStarDefines.h b/Common/DStarDefines.h index 8ea9ae6..b0c3972 100644 --- a/Common/DStarDefines.h +++ b/Common/DStarDefines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2015 by Jonathan Naylor, G4KLX + * Copyright (C) 2009-2015,2018,2019 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 @@ -31,8 +31,7 @@ const bool DATA_SYNC_BITS[] = {true, false, true, false, true, false, true, true, false, true, true, false, true, false, false, false, true, true, false, true, false, false, false}; -const unsigned char END_PATTERN_BYTES[] = {0x55, 0x55, 0x55, 0x55, 0xC8, 0x7A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +const unsigned char END_PATTERN_BYTES[] = {0x55, 0x55, 0x55, 0x55, 0xC8, 0x7A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; const bool END_PATTERN_BITS[] = {true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, @@ -83,10 +82,14 @@ const unsigned int DATA_BLOCK_SIZE_BYTES = 21U * DV_FRAME_LENGTH_BYTES; const unsigned int LONG_CALLSIGN_LENGTH = 8U; const unsigned int SHORT_CALLSIGN_LENGTH = 4U; -const unsigned char SLOW_DATA_TYPE_MASK = 0xF0U; -const unsigned char SLOW_DATA_TYPE_GPS = 0x30U; -const unsigned char SLOW_DATA_TYPE_TEXT = 0x40U; -const unsigned char SLOW_DATA_TYPE_HEADER = 0x50U; +const unsigned char SLOW_DATA_TYPE_MASK = 0xF0U; +const unsigned char SLOW_DATA_TYPE_GPS = 0x30U; +const unsigned char SLOW_DATA_TYPE_TEXT = 0x40U; +const unsigned char SLOW_DATA_TYPE_HEADER = 0x50U; +const unsigned char SLOW_DATA_TYPE_FAST_DATA1 = 0x80U; +const unsigned char SLOW_DATA_TYPE_FAST_DATA2 = 0x90U; +const unsigned char SLOW_DATA_TYPE_SQUELCH = 0xC0U; +const unsigned char SLOW_DATA_LENGTH_MASK = 0x0FU; const unsigned char DATA_MASK = 0x80U; const unsigned char REPEATER_MASK = 0x40U; diff --git a/Common/DTMF.cpp b/Common/DTMF.cpp index a05cbed..bab79c3 100644 --- a/Common/DTMF.cpp +++ b/Common/DTMF.cpp @@ -167,6 +167,8 @@ wxString CDTMF::translate() return processReflector(wxT("XRF"), command.Mid(1U)); else if (command.GetChar(0U) == wxT('D')) return processReflector(wxT("DCS"), command.Mid(1U)); + else if (command.GetChar(0U) == wxT('A')) + return processReflector(wxT("XLX"), command.Mid(1U)); else return processCCS(command); } diff --git a/Common/G2ProtocolHandler.cpp b/Common/G2ProtocolHandler.cpp index 8f68b98..28c2a60 100644 --- a/Common/G2ProtocolHandler.cpp +++ b/Common/G2ProtocolHandler.cpp @@ -144,6 +144,20 @@ CAMBEData* CG2ProtocolHandler::readAMBE() return data; } +#if defined(ENABLE_NAT_TRAVERSAL) +void CG2ProtocolHandler::traverseNat(const wxString& address) +{ + unsigned char buffer[1]; + ::memset(buffer, 0, 1); + + in_addr addr = CUDPReaderWriter::lookup(address); + + //wxLogError(wxT("Punching hole to %s"), address.mb_str()); + + m_socket.write(buffer, 1, addr, G2_DV_PORT); +} +#endif + void CG2ProtocolHandler::close() { m_socket.close(); diff --git a/Common/G2ProtocolHandler.h b/Common/G2ProtocolHandler.h index 3a87834..0a60896 100644 --- a/Common/G2ProtocolHandler.h +++ b/Common/G2ProtocolHandler.h @@ -52,6 +52,10 @@ public: CHeaderData* readHeader(); CAMBEData* readAMBE(); +#if defined(ENABLE_NAT_TRAVERSAL) + void traverseNat(const wxString& addr); +#endif + void close(); private: diff --git a/Common/IRCDDBGatewayConfig.cpp b/Common/IRCDDBGatewayConfig.cpp index 9e97d14..4931656 100644 --- a/Common/IRCDDBGatewayConfig.cpp +++ b/Common/IRCDDBGatewayConfig.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2020 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 @@ -112,10 +112,10 @@ const wxString KEY_URL4 = wxT("url4"); const wxString KEY_BAND41 = wxT("band4_1"); const wxString KEY_BAND42 = wxT("band4_2"); const wxString KEY_BAND43 = wxT("band4_3"); -const wxString KEY_IRCDDB_ENABLED = wxT("ircddbEnabled"); -const wxString KEY_IRCDDB_HOSTNAME = wxT("ircddbHostname"); -const wxString KEY_IRCDDB_USERNAME = wxT("ircddbUsername"); -const wxString KEY_IRCDDB_PASSWORD = wxT("ircddbPassword"); +const wxString KEY_IRCDDB_ENABLED1 = wxT("ircddbEnabled"); +const wxString KEY_IRCDDB_HOSTNAME1 = wxT("ircddbHostname"); +const wxString KEY_IRCDDB_USERNAME1 = wxT("ircddbUsername"); +const wxString KEY_IRCDDB_PASSWORD1 = wxT("ircddbPassword"); const wxString KEY_IRCDDB_ENABLED2 = wxT("ircddbEnabled2"); const wxString KEY_IRCDDB_HOSTNAME2 = wxT("ircddbHostname2"); const wxString KEY_IRCDDB_USERNAME2 = wxT("ircddbUsername2"); @@ -129,7 +129,7 @@ const wxString KEY_IRCDDB_HOSTNAME4 = wxT("ircddbHostname4"); const wxString KEY_IRCDDB_USERNAME4 = wxT("ircddbUsername4"); const wxString KEY_IRCDDB_PASSWORD4 = wxT("ircddbPassword4"); const wxString KEY_APRS_ENABLED = wxT("aprsEnabled"); -const wxString KEY_APRS_HOSTNAME = wxT("aprsHostname"); +const wxString KEY_APRS_ADDRESS = wxT("aprsAddress"); const wxString KEY_APRS_PORT = wxT("aprsPort"); const wxString KEY_DEXTRA_ENABLED = wxT("dextraEnabled"); const wxString KEY_DEXTRA_MAXDONGLES = wxT("dextraMaxDongles"); @@ -139,8 +139,7 @@ const wxString KEY_DPLUS_LOGIN = wxT("dplusLogin"); const wxString KEY_DCS_ENABLED = wxT("dcsEnabled"); const wxString KEY_CCS_ENABLED = wxT("ccsEnabled"); const wxString KEY_CCS_HOST = wxT("ccsHost"); -const wxString KEY_XLX_ENABLED = wxT("xlxEnabled"); -const wxString KEY_XLX_OVERRIDE_LOCAL = wxT("xlxOverrideLocal"); +const wxString KEY_XLX_ENABLED = wxT("xlxEnabled"); const wxString KEY_XLX_HOSTS_FILE_URL = wxT("xlxHostsFileUrl"); const wxString KEY_STARNET_BAND1 = wxT("starNetBand1"); const wxString KEY_STARNET_CALLSIGN1 = wxT("starNetCallsign1"); @@ -201,6 +200,9 @@ const wxString KEY_ECHO_ENABLED = wxT("echoEnabled"); const wxString KEY_LOG_ENABLED = wxT("logEnabled"); const wxString KEY_DRATS_ENABLED = wxT("dratsEnabled"); const wxString KEY_DTMF_ENABLED = wxT("dtmfEnabled"); +const wxString KEY_GPSD_ENABLED = wxT("gpsdEnabled"); +const wxString KEY_GPSD_ADDRESS = wxT("gpsdAddress"); +const wxString KEY_GPSD_PORT = wxT("gpsdPort"); const wxString KEY_WINDOW_X = wxT("windowX"); const wxString KEY_WINDOW_Y = wxT("windowY"); @@ -234,10 +236,10 @@ const unsigned int DEFAULT_REPEATER_PORT1 = 20011U; const unsigned int DEFAULT_REPEATER_PORT2 = 20012U; const unsigned int DEFAULT_REPEATER_PORT3 = 20013U; const unsigned int DEFAULT_REPEATER_PORT4 = 20014U; -const bool DEFAULT_IRCDDB_ENABLED = true; -const wxString DEFAULT_IRCDDB_HOSTNAME = wxT("group1-irc.ircddb.net"); -const wxString DEFAULT_IRCDDB_USERNAME = wxEmptyString; -const wxString DEFAULT_IRCDDB_PASSWORD = wxEmptyString; +const bool DEFAULT_IRCDDB_ENABLED1 = true; +const wxString DEFAULT_IRCDDB_HOSTNAME1 = wxT("group1-irc.ircddb.net"); +const wxString DEFAULT_IRCDDB_USERNAME1 = wxEmptyString; +const wxString DEFAULT_IRCDDB_PASSWORD1 = wxEmptyString; const bool DEFAULT_IRCDDB_ENABLED2 = true; const wxString DEFAULT_IRCDDB_HOSTNAME2 = wxT("rr.openquad.net"); const wxString DEFAULT_IRCDDB_USERNAME2 = wxEmptyString; @@ -250,9 +252,9 @@ const bool DEFAULT_IRCDDB_ENABLED4 = false; const wxString DEFAULT_IRCDDB_HOSTNAME4 = wxEmptyString; const wxString DEFAULT_IRCDDB_USERNAME4 = wxEmptyString; const wxString DEFAULT_IRCDDB_PASSWORD4 = wxEmptyString; -const bool DEFAULT_APRS_ENABLED = true; -const wxString DEFAULT_APRS_HOSTNAME = wxT("rotate.aprs2.net"); -const unsigned int DEFAULT_APRS_PORT = 14580U; +const bool DEFAULT_APRS_ENABLED = false; +const wxString DEFAULT_APRS_ADDRESS = wxT("127.0.0.1"); +const unsigned int DEFAULT_APRS_PORT = 8673U; const bool DEFAULT_DEXTRA_ENABLED = true; const unsigned int DEFAULT_DEXTRA_MAXDONGLES = 5U; const bool DEFAULT_DPLUS_ENABLED = false; @@ -261,9 +263,8 @@ const wxString DEFAULT_DPLUS_LOGIN = wxEmptyString; const bool DEFAULT_DCS_ENABLED = true; const bool DEFAULT_CCS_ENABLED = true; const wxString DEFAULT_CCS_HOST = wxT("CCS704 "); -const bool DEFAULT_XLX_ENABLED = true; -const bool DEFAULT_XLX_OVERRIDE_LOCAL = true; -const wxString DEFAULT_XLX_HOSTS_FILE_URL = _T("http://xlxapi.rlx.lu/api.php?do=GetReflectorHostname"); +const bool DEFAULT_XLX_ENABLED = true; +const wxString DEFAULT_XLX_HOSTS_FILE_URL = wxT("http://xlxapi.rlx.lu/api.php?do=GetXLXDMRMaster");//we use the XLXDMRMaster list because it starts with XLX instead of DCS, XRF etc .... const wxString DEFAULT_STARNET_BAND = wxEmptyString; const wxString DEFAULT_STARNET_CALLSIGN = wxEmptyString; const wxString DEFAULT_STARNET_LOGOFF = wxEmptyString; @@ -283,6 +284,9 @@ const bool DEFAULT_INFO_ENABLED = true; const bool DEFAULT_ECHO_ENABLED = true; const bool DEFAULT_DRATS_ENABLED = false; const bool DEFAULT_DTMF_ENABLED = true; +const bool DEFAULT_GPSD_ENABLED = false; +const wxString DEFAULT_GPSD_ADDRESS = wxT("127.0.0.1"); +const wxString DEFAULT_GPSD_PORT = wxT("2947"); const int DEFAULT_WINDOW_X = -1; const int DEFAULT_WINDOW_Y = -1; @@ -385,10 +389,10 @@ m_repeater4URL(DEFAULT_URL), m_repeater4Band1(DEFAULT_BAND1), m_repeater4Band2(DEFAULT_BAND2), m_repeater4Band3(DEFAULT_BAND3), -m_ircddbEnabled(DEFAULT_IRCDDB_ENABLED), -m_ircddbHostname(DEFAULT_IRCDDB_HOSTNAME), -m_ircddbUsername(DEFAULT_IRCDDB_USERNAME), -m_ircddbPassword(DEFAULT_IRCDDB_PASSWORD), +m_ircddbEnabled1(DEFAULT_IRCDDB_ENABLED1), +m_ircddbHostname1(DEFAULT_IRCDDB_HOSTNAME1), +m_ircddbUsername1(DEFAULT_IRCDDB_USERNAME1), +m_ircddbPassword1(DEFAULT_IRCDDB_PASSWORD1), m_ircddbEnabled2(DEFAULT_IRCDDB_ENABLED2), m_ircddbHostname2(DEFAULT_IRCDDB_HOSTNAME2), m_ircddbUsername2(DEFAULT_IRCDDB_USERNAME2), @@ -402,7 +406,7 @@ m_ircddbHostname4(DEFAULT_IRCDDB_HOSTNAME4), m_ircddbUsername4(DEFAULT_IRCDDB_USERNAME4), m_ircddbPassword4(DEFAULT_IRCDDB_PASSWORD4), m_aprsEnabled(DEFAULT_APRS_ENABLED), -m_aprsHostname(DEFAULT_APRS_HOSTNAME), +m_aprsAddress(DEFAULT_APRS_ADDRESS), m_aprsPort(DEFAULT_APRS_PORT), m_dextraEnabled(DEFAULT_DEXTRA_ENABLED), m_dextraMaxDongles(DEFAULT_DEXTRA_MAXDONGLES), @@ -413,7 +417,6 @@ m_dcsEnabled(DEFAULT_DCS_ENABLED), m_ccsEnabled(DEFAULT_CCS_ENABLED), m_ccsHost(DEFAULT_CCS_HOST), m_xlxEnabled(DEFAULT_XLX_ENABLED), -m_xlxOverrideLocal(DEFAULT_XLX_OVERRIDE_LOCAL), m_xlxHostsFileUrl(DEFAULT_XLX_HOSTS_FILE_URL), m_starNet1Band(DEFAULT_STARNET_BAND), m_starNet1Callsign(DEFAULT_STARNET_CALLSIGN), @@ -474,6 +477,9 @@ m_echoEnabled(DEFAULT_ECHO_ENABLED), m_logEnabled(DEFAULT_LOG_ENABLED), m_dratsEnabled(DEFAULT_DRATS_ENABLED), m_dtmfEnabled(DEFAULT_DTMF_ENABLED), +m_gpsdEnabled(DEFAULT_GPSD_ENABLED), +m_gpsdAddress(DEFAULT_GPSD_ADDRESS), +m_gpsdPort(DEFAULT_GPSD_PORT), m_x(DEFAULT_WINDOW_X), m_y(DEFAULT_WINDOW_Y) { @@ -701,29 +707,29 @@ m_y(DEFAULT_WINDOW_Y) m_config->Read(m_name + KEY_BAND43, &temp, long(DEFAULT_BAND3)); m_repeater4Band3 = (unsigned char)temp; - m_config->Read(m_name + KEY_IRCDDB_ENABLED, &m_ircddbEnabled, DEFAULT_IRCDDB_ENABLED); - m_config->Read(m_name + KEY_IRCDDB_HOSTNAME, &m_ircddbHostname, DEFAULT_IRCDDB_HOSTNAME); - m_config->Read(m_name + KEY_IRCDDB_USERNAME, &m_ircddbUsername, DEFAULT_IRCDDB_USERNAME); - m_config->Read(m_name + KEY_IRCDDB_PASSWORD, &m_ircddbPassword, DEFAULT_IRCDDB_PASSWORD); + m_config->Read(m_name + KEY_IRCDDB_ENABLED1, &m_ircddbEnabled1, DEFAULT_IRCDDB_ENABLED1); + m_config->Read(m_name + KEY_IRCDDB_HOSTNAME1, &m_ircddbHostname1, DEFAULT_IRCDDB_HOSTNAME1); + m_config->Read(m_name + KEY_IRCDDB_USERNAME1, &m_ircddbUsername1, DEFAULT_IRCDDB_USERNAME1); + m_config->Read(m_name + KEY_IRCDDB_PASSWORD1, &m_ircddbPassword1, DEFAULT_IRCDDB_PASSWORD1); - m_config->Read(m_name + KEY_IRCDDB_ENABLED2, &m_ircddbEnabled, DEFAULT_IRCDDB_ENABLED2); - m_config->Read(m_name + KEY_IRCDDB_HOSTNAME2, &m_ircddbHostname, DEFAULT_IRCDDB_HOSTNAME2); - m_config->Read(m_name + KEY_IRCDDB_USERNAME2, &m_ircddbUsername, DEFAULT_IRCDDB_USERNAME2); - m_config->Read(m_name + KEY_IRCDDB_PASSWORD2, &m_ircddbPassword, DEFAULT_IRCDDB_PASSWORD2); + m_config->Read(m_name + KEY_IRCDDB_ENABLED2, &m_ircddbEnabled2, DEFAULT_IRCDDB_ENABLED2); + m_config->Read(m_name + KEY_IRCDDB_HOSTNAME2, &m_ircddbHostname2, DEFAULT_IRCDDB_HOSTNAME2); + m_config->Read(m_name + KEY_IRCDDB_USERNAME2, &m_ircddbUsername2, DEFAULT_IRCDDB_USERNAME2); + m_config->Read(m_name + KEY_IRCDDB_PASSWORD2, &m_ircddbPassword2, DEFAULT_IRCDDB_PASSWORD2); - m_config->Read(m_name + KEY_IRCDDB_ENABLED3, &m_ircddbEnabled, DEFAULT_IRCDDB_ENABLED3); - m_config->Read(m_name + KEY_IRCDDB_HOSTNAME3, &m_ircddbHostname, DEFAULT_IRCDDB_HOSTNAME3); - m_config->Read(m_name + KEY_IRCDDB_USERNAME3, &m_ircddbUsername, DEFAULT_IRCDDB_USERNAME3); - m_config->Read(m_name + KEY_IRCDDB_PASSWORD3, &m_ircddbPassword, DEFAULT_IRCDDB_PASSWORD3); + m_config->Read(m_name + KEY_IRCDDB_ENABLED3, &m_ircddbEnabled3, DEFAULT_IRCDDB_ENABLED3); + m_config->Read(m_name + KEY_IRCDDB_HOSTNAME3, &m_ircddbHostname3, DEFAULT_IRCDDB_HOSTNAME3); + m_config->Read(m_name + KEY_IRCDDB_USERNAME3, &m_ircddbUsername3, DEFAULT_IRCDDB_USERNAME3); + m_config->Read(m_name + KEY_IRCDDB_PASSWORD3, &m_ircddbPassword3, DEFAULT_IRCDDB_PASSWORD3); - m_config->Read(m_name + KEY_IRCDDB_ENABLED4, &m_ircddbEnabled, DEFAULT_IRCDDB_ENABLED4); - m_config->Read(m_name + KEY_IRCDDB_HOSTNAME4, &m_ircddbHostname, DEFAULT_IRCDDB_HOSTNAME4); - m_config->Read(m_name + KEY_IRCDDB_USERNAME4, &m_ircddbUsername, DEFAULT_IRCDDB_USERNAME4); - m_config->Read(m_name + KEY_IRCDDB_PASSWORD4, &m_ircddbPassword, DEFAULT_IRCDDB_PASSWORD4); + m_config->Read(m_name + KEY_IRCDDB_ENABLED4, &m_ircddbEnabled4, DEFAULT_IRCDDB_ENABLED4); + m_config->Read(m_name + KEY_IRCDDB_HOSTNAME4, &m_ircddbHostname4, DEFAULT_IRCDDB_HOSTNAME4); + m_config->Read(m_name + KEY_IRCDDB_USERNAME4, &m_ircddbUsername4, DEFAULT_IRCDDB_USERNAME4); + m_config->Read(m_name + KEY_IRCDDB_PASSWORD4, &m_ircddbPassword4, DEFAULT_IRCDDB_PASSWORD4); m_config->Read(m_name + KEY_APRS_ENABLED, &m_aprsEnabled, DEFAULT_APRS_ENABLED); - m_config->Read(m_name + KEY_APRS_HOSTNAME, &m_aprsHostname, DEFAULT_APRS_HOSTNAME); + m_config->Read(m_name + KEY_APRS_ADDRESS, &m_aprsAddress, DEFAULT_APRS_ADDRESS); m_config->Read(m_name + KEY_APRS_PORT, &temp, long(DEFAULT_APRS_PORT)); m_aprsPort = (unsigned int)temp; @@ -747,10 +753,10 @@ m_y(DEFAULT_WINDOW_Y) m_config->Read(m_name + KEY_CCS_HOST, &m_ccsHost, DEFAULT_CCS_HOST); m_config->Read(m_name + KEY_XLX_ENABLED, &m_xlxEnabled, DEFAULT_XLX_ENABLED); - - m_config->Read(m_name + KEY_XLX_OVERRIDE_LOCAL, &m_xlxOverrideLocal, DEFAULT_XLX_OVERRIDE_LOCAL); - + m_config->Read(m_name + KEY_XLX_HOSTS_FILE_URL, &m_xlxHostsFileUrl, DEFAULT_XLX_HOSTS_FILE_URL); + if(m_xlxEnabled && m_xlxHostsFileUrl.Trim().IsEmpty())//To avoid support nightmare, fill the url with the default one when xlx is enabled and the url is left empty + m_xlxHostsFileUrl = DEFAULT_XLX_HOSTS_FILE_URL; m_config->Read(m_name + KEY_STARNET_BAND1, &m_starNet1Band, DEFAULT_STARNET_BAND); @@ -887,6 +893,13 @@ m_y(DEFAULT_WINDOW_Y) m_config->Read(m_name + KEY_DTMF_ENABLED, &m_dtmfEnabled, DEFAULT_DTMF_ENABLED); + m_config->Read(m_name + KEY_GPSD_ENABLED, &m_gpsdEnabled, DEFAULT_GPSD_ENABLED); + + m_config->Read(m_name + KEY_GPSD_ADDRESS, &m_gpsdAddress, DEFAULT_GPSD_ADDRESS); + + m_config->Read(m_name + KEY_GPSD_PORT, &temp, long(DEFAULT_GPSD_PORT)); + m_gpsdPort = (unsigned int)temp; + m_config->Read(m_name + KEY_WINDOW_X, &temp, long(DEFAULT_WINDOW_X)); m_x = int(temp); @@ -995,10 +1008,10 @@ m_repeater4URL(DEFAULT_URL), m_repeater4Band1(DEFAULT_BAND1), m_repeater4Band2(DEFAULT_BAND2), m_repeater4Band3(DEFAULT_BAND3), -m_ircddbEnabled(DEFAULT_IRCDDB_ENABLED), -m_ircddbHostname(DEFAULT_IRCDDB_HOSTNAME), -m_ircddbUsername(DEFAULT_IRCDDB_USERNAME), -m_ircddbPassword(DEFAULT_IRCDDB_PASSWORD), +m_ircddbEnabled1(DEFAULT_IRCDDB_ENABLED1), +m_ircddbHostname1(DEFAULT_IRCDDB_HOSTNAME1), +m_ircddbUsername1(DEFAULT_IRCDDB_USERNAME1), +m_ircddbPassword1(DEFAULT_IRCDDB_PASSWORD1), m_ircddbEnabled2(DEFAULT_IRCDDB_ENABLED2), m_ircddbHostname2(DEFAULT_IRCDDB_HOSTNAME2), m_ircddbUsername2(DEFAULT_IRCDDB_USERNAME2), @@ -1012,7 +1025,7 @@ m_ircddbHostname4(DEFAULT_IRCDDB_HOSTNAME4), m_ircddbUsername4(DEFAULT_IRCDDB_USERNAME4), m_ircddbPassword4(DEFAULT_IRCDDB_PASSWORD4), m_aprsEnabled(DEFAULT_APRS_ENABLED), -m_aprsHostname(DEFAULT_APRS_HOSTNAME), +m_aprsAddress(DEFAULT_APRS_ADDRESS), m_aprsPort(DEFAULT_APRS_PORT), m_dextraEnabled(DEFAULT_DEXTRA_ENABLED), m_dextraMaxDongles(DEFAULT_DEXTRA_MAXDONGLES), @@ -1023,7 +1036,6 @@ m_dcsEnabled(DEFAULT_DCS_ENABLED), m_ccsEnabled(DEFAULT_CCS_ENABLED), m_ccsHost(DEFAULT_CCS_HOST), m_xlxEnabled(DEFAULT_XLX_ENABLED), -m_xlxOverrideLocal(DEFAULT_XLX_OVERRIDE_LOCAL), m_xlxHostsFileUrl(DEFAULT_XLX_HOSTS_FILE_URL), m_starNet1Band(DEFAULT_STARNET_BAND), m_starNet1Callsign(DEFAULT_STARNET_CALLSIGN), @@ -1084,6 +1096,9 @@ m_echoEnabled(DEFAULT_ECHO_ENABLED), m_logEnabled(DEFAULT_LOG_ENABLED), m_dratsEnabled(DEFAULT_DRATS_ENABLED), m_dtmfEnabled(DEFAULT_DTMF_ENABLED), +m_gpsdEnabled(DEFAULT_GPSD_ENABLED), +m_gpsdAddress(DEFAULT_GPSD_ADDRESS), +m_gpsdPort(DEFAULT_GPSD_PORT), m_x(DEFAULT_WINDOW_X), m_y(DEFAULT_WINDOW_Y) { @@ -1342,15 +1357,15 @@ m_y(DEFAULT_WINDOW_Y) } else if (key.IsSameAs(KEY_BAND43)) { val.ToULong(&temp2); m_repeater4Band3 = (unsigned char)temp2; - } else if (key.IsSameAs(KEY_IRCDDB_ENABLED)) { + } else if (key.IsSameAs(KEY_IRCDDB_ENABLED1)) { val.ToLong(&temp1); - m_ircddbEnabled = temp1 == 1L; - } else if (key.IsSameAs(KEY_IRCDDB_HOSTNAME)) { - m_ircddbHostname = val; - } else if (key.IsSameAs(KEY_IRCDDB_USERNAME)) { - m_ircddbUsername = val; - } else if (key.IsSameAs(KEY_IRCDDB_PASSWORD)) { - m_ircddbPassword = val; + m_ircddbEnabled1 = temp1 == 1L; + } else if (key.IsSameAs(KEY_IRCDDB_HOSTNAME1)) { + m_ircddbHostname1 = val; + } else if (key.IsSameAs(KEY_IRCDDB_USERNAME1)) { + m_ircddbUsername1 = val; + } else if (key.IsSameAs(KEY_IRCDDB_PASSWORD1)) { + m_ircddbPassword1 = val; } else if (key.IsSameAs(KEY_IRCDDB_ENABLED2)) { val.ToLong(&temp1); m_ircddbEnabled2 = temp1 == 1L; @@ -1381,8 +1396,8 @@ m_y(DEFAULT_WINDOW_Y) } else if (key.IsSameAs(KEY_APRS_ENABLED)) { val.ToLong(&temp1); m_aprsEnabled = temp1 == 1L; - } else if (key.IsSameAs(KEY_APRS_HOSTNAME)) { - m_aprsHostname = val; + } else if (key.IsSameAs(KEY_APRS_ADDRESS)) { + m_aprsAddress = val; } else if (key.IsSameAs(KEY_APRS_PORT)) { val.ToULong(&temp2); m_aprsPort = (unsigned int)temp2; @@ -1411,10 +1426,7 @@ m_y(DEFAULT_WINDOW_Y) } else if (key.IsSameAs(KEY_XLX_ENABLED)) { val.ToLong(&temp1); m_xlxEnabled = temp1 == 1L; - } else if (key.IsSameAs(KEY_XLX_OVERRIDE_LOCAL)) { - val.ToLong(&temp1); - m_xlxOverrideLocal = temp1 == 1L; - } else if (key.IsSameAs(KEY_XLX_HOSTS_FILE_URL)) { + } else if (key.IsSameAs(KEY_XLX_HOSTS_FILE_URL) && !val.Trim().IsEmpty()) { //always load default url if the value in the config file is empty m_xlxHostsFileUrl = val; } else if (key.IsSameAs(KEY_STARNET_BAND1)) { m_starNet1Band = val; @@ -1562,6 +1574,13 @@ m_y(DEFAULT_WINDOW_Y) } else if (key.IsSameAs(KEY_DTMF_ENABLED)) { val.ToLong(&temp1); m_dtmfEnabled = temp1 == 1L; + } else if (key.IsSameAs(KEY_GPSD_ENABLED)) { + val.ToLong(&temp1); + m_gpsdEnabled = temp1 == 1L; + } else if (key.IsSameAs(KEY_GPSD_ADDRESS)) { + m_gpsdAddress = val; + } else if (key.IsSameAs(KEY_GPSD_PORT)) { + m_gpsdPort = val; } else if (key.IsSameAs(KEY_WINDOW_X)) { val.ToLong(&temp1); m_x = int(temp1); @@ -1805,20 +1824,20 @@ void CIRCDDBGatewayConfig::setRepeater4(const wxString& band, HW_TYPE type, cons m_repeater4URL = url; } -void CIRCDDBGatewayConfig::getIrcDDB(bool& enabled, wxString& hostname, wxString& username, wxString& password) const +void CIRCDDBGatewayConfig::getIrcDDB1(bool& enabled, wxString& hostname, wxString& username, wxString& password) const { - enabled = m_ircddbEnabled; - hostname = m_ircddbHostname; - username = m_ircddbUsername; - password = m_ircddbPassword; + enabled = m_ircddbEnabled1; + hostname = m_ircddbHostname1; + username = m_ircddbUsername1; + password = m_ircddbPassword1; } -void CIRCDDBGatewayConfig::setIrcDDB(bool enabled, const wxString& hostname, const wxString& username, const wxString& password) +void CIRCDDBGatewayConfig::setIrcDDB1(bool enabled, const wxString& hostname, const wxString& username, const wxString& password) { - m_ircddbEnabled = enabled; - m_ircddbHostname = hostname; - m_ircddbUsername = username; - m_ircddbPassword = password; + m_ircddbEnabled1 = enabled; + m_ircddbHostname1 = hostname; + m_ircddbUsername1 = username; + m_ircddbPassword1 = password; } void CIRCDDBGatewayConfig::getIrcDDB2(bool& enabled, wxString& hostname, wxString& username, wxString& password) const @@ -1826,14 +1845,6 @@ void CIRCDDBGatewayConfig::getIrcDDB2(bool& enabled, wxString& hostname, wxStrin enabled = m_ircddbEnabled2; hostname = m_ircddbHostname2; username = m_ircddbUsername2; - - /*if(username.IsEmpty()){ - //no user specified for openquad? use the one from the default network ! - username = m_ircddbUsername; - if(username[0] >= '0' && username[0] <= '9') - username = wxT("r") + username; - }*/ - password = m_ircddbPassword2; } @@ -1877,17 +1888,17 @@ void CIRCDDBGatewayConfig::setIrcDDB4(bool enabled, const wxString& hostname, co m_ircddbPassword4 = password; } -void CIRCDDBGatewayConfig::getDPRS(bool& enabled, wxString& hostname, unsigned int& port) const +void CIRCDDBGatewayConfig::getDPRS(bool& enabled, wxString& address, unsigned int& port) const { - enabled = m_aprsEnabled; - hostname = m_aprsHostname; - port = m_aprsPort; + enabled = m_aprsEnabled; + address = m_aprsAddress; + port = m_aprsPort; } -void CIRCDDBGatewayConfig::setDPRS(bool enabled, const wxString& hostname, unsigned int port) +void CIRCDDBGatewayConfig::setDPRS(bool enabled, const wxString& address, unsigned int port) { m_aprsEnabled = enabled; - m_aprsHostname = hostname; + m_aprsAddress = address; m_aprsPort = port; } @@ -1931,17 +1942,15 @@ void CIRCDDBGatewayConfig::setDCS(bool dcsEnabled, bool ccsEnabled, const wxStri m_ccsHost = ccsHost; } -void CIRCDDBGatewayConfig::getXLX(bool& xlxEnabled, bool& xlxOverrideLocal, wxString& xlxHostsFileUrl) +void CIRCDDBGatewayConfig::getXLX(bool& xlxEnabled, wxString& xlxHostsFileUrl) { xlxEnabled = m_xlxEnabled; - xlxOverrideLocal = m_xlxOverrideLocal; xlxHostsFileUrl = m_xlxHostsFileUrl; } -void CIRCDDBGatewayConfig::setXLX(bool xlxEnabled, bool xlxOverrideLocal, wxString xlxHostsFileUrl) +void CIRCDDBGatewayConfig::setXLX(bool xlxEnabled, wxString xlxHostsFileUrl) { m_xlxEnabled = xlxEnabled; - m_xlxOverrideLocal = xlxOverrideLocal; m_xlxHostsFileUrl = xlxHostsFileUrl; } @@ -2189,6 +2198,20 @@ void CIRCDDBGatewayConfig::setMiscellaneous(TEXT_LANG language, bool infoEnabled m_dtmfEnabled = dtmfEnabled; } +void CIRCDDBGatewayConfig::getGPSD(bool& enabled, wxString& address, wxString& port) const +{ + enabled = m_gpsdEnabled; + address = m_gpsdAddress; + port = m_gpsdPort; +} + +void CIRCDDBGatewayConfig::setGPSD(bool enabled, const wxString& address, const wxString& port) +{ + m_gpsdEnabled = enabled; + m_gpsdAddress = address; + m_gpsdPort = port; +} + void CIRCDDBGatewayConfig::getPosition(int& x, int& y) const { x = m_x; @@ -2339,10 +2362,10 @@ bool CIRCDDBGatewayConfig::write() m_config->Write(m_name + KEY_BAND41, long(m_repeater4Band1)); m_config->Write(m_name + KEY_BAND42, long(m_repeater4Band2)); m_config->Write(m_name + KEY_BAND43, long(m_repeater4Band3)); - m_config->Write(m_name + KEY_IRCDDB_ENABLED, m_ircddbEnabled); - m_config->Write(m_name + KEY_IRCDDB_HOSTNAME, m_ircddbHostname); - m_config->Write(m_name + KEY_IRCDDB_USERNAME, m_ircddbUsername); - m_config->Write(m_name + KEY_IRCDDB_PASSWORD, m_ircddbPassword); + m_config->Write(m_name + KEY_IRCDDB_ENABLED1, m_ircddbEnabled1); + m_config->Write(m_name + KEY_IRCDDB_HOSTNAME1, m_ircddbHostname1); + m_config->Write(m_name + KEY_IRCDDB_USERNAME1, m_ircddbUsername1); + m_config->Write(m_name + KEY_IRCDDB_PASSWORD1, m_ircddbPassword1); m_config->Write(m_name + KEY_IRCDDB_ENABLED2, m_ircddbEnabled2); m_config->Write(m_name + KEY_IRCDDB_HOSTNAME2, m_ircddbHostname2); m_config->Write(m_name + KEY_IRCDDB_USERNAME2, m_ircddbUsername2); @@ -2356,7 +2379,7 @@ bool CIRCDDBGatewayConfig::write() m_config->Write(m_name + KEY_IRCDDB_USERNAME4, m_ircddbUsername4); m_config->Write(m_name + KEY_IRCDDB_PASSWORD4, m_ircddbPassword4); m_config->Write(m_name + KEY_APRS_ENABLED, m_aprsEnabled); - m_config->Write(m_name + KEY_APRS_HOSTNAME, m_aprsHostname); + m_config->Write(m_name + KEY_APRS_ADDRESS, m_aprsAddress); m_config->Write(m_name + KEY_APRS_PORT, long(m_aprsPort)); m_config->Write(m_name + KEY_DEXTRA_ENABLED, m_dextraEnabled); m_config->Write(m_name + KEY_DEXTRA_MAXDONGLES, long(m_dextraMaxDongles)); @@ -2367,7 +2390,6 @@ bool CIRCDDBGatewayConfig::write() m_config->Write(m_name + KEY_CCS_ENABLED, m_ccsEnabled); m_config->Write(m_name + KEY_CCS_HOST, m_ccsHost); m_config->Write(m_name + KEY_XLX_ENABLED, m_xlxEnabled); - m_config->Write(m_name + KEY_XLX_OVERRIDE_LOCAL, m_xlxOverrideLocal); m_config->Write(m_name + KEY_XLX_HOSTS_FILE_URL, m_xlxHostsFileUrl); m_config->Write(m_name + KEY_STARNET_BAND1, m_starNet1Band); m_config->Write(m_name + KEY_STARNET_CALLSIGN1, m_starNet1Callsign); @@ -2428,6 +2450,9 @@ bool CIRCDDBGatewayConfig::write() m_config->Write(m_name + KEY_LOG_ENABLED, m_logEnabled); m_config->Write(m_name + KEY_DRATS_ENABLED, m_dratsEnabled); m_config->Write(m_name + KEY_DTMF_ENABLED, m_dtmfEnabled); + m_config->Write(m_name + KEY_GPSD_ENABLED, m_gpsdEnabled); + m_config->Write(m_name + KEY_GPSD_ADDRESS, m_gpsdAddress); + m_config->Write(m_name + KEY_GPSD_PORT, m_gpsdPort); m_config->Write(m_name + KEY_WINDOW_X, long(m_x)); m_config->Write(m_name + KEY_WINDOW_Y, long(m_y)); m_config->Flush(); @@ -2546,10 +2571,10 @@ bool CIRCDDBGatewayConfig::write() buffer.Printf(wxT("%s=%u"), KEY_BAND41.c_str(), m_repeater4Band1); file.AddLine(buffer); buffer.Printf(wxT("%s=%u"), KEY_BAND42.c_str(), m_repeater4Band2); file.AddLine(buffer); buffer.Printf(wxT("%s=%u"), KEY_BAND43.c_str(), m_repeater4Band3); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_IRCDDB_ENABLED.c_str(), m_ircddbEnabled ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_IRCDDB_HOSTNAME.c_str(), m_ircddbHostname.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_IRCDDB_USERNAME.c_str(), m_ircddbUsername.c_str()); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_IRCDDB_PASSWORD.c_str(), m_ircddbPassword.c_str()); file.AddLine(buffer); + buffer.Printf(wxT("%s=%d"), KEY_IRCDDB_ENABLED1.c_str(), m_ircddbEnabled1 ? 1 : 0); file.AddLine(buffer); + buffer.Printf(wxT("%s=%s"), KEY_IRCDDB_HOSTNAME1.c_str(), m_ircddbHostname1.c_str()); file.AddLine(buffer); + buffer.Printf(wxT("%s=%s"), KEY_IRCDDB_USERNAME1.c_str(), m_ircddbUsername1.c_str()); file.AddLine(buffer); + buffer.Printf(wxT("%s=%s"), KEY_IRCDDB_PASSWORD1.c_str(), m_ircddbPassword1.c_str()); file.AddLine(buffer); buffer.Printf("%s=%d", KEY_IRCDDB_ENABLED2.c_str(), m_ircddbEnabled2 ? 1 : 0); file.AddLine(buffer); buffer.Printf("%s=%s", KEY_IRCDDB_HOSTNAME2.c_str(), m_ircddbHostname2.c_str()); file.AddLine(buffer); buffer.Printf("%s=%s", KEY_IRCDDB_USERNAME2.c_str(), m_ircddbUsername2.c_str()); file.AddLine(buffer); @@ -2563,7 +2588,7 @@ bool CIRCDDBGatewayConfig::write() buffer.Printf("%s=%s", KEY_IRCDDB_USERNAME4.c_str(), m_ircddbUsername4.c_str()); file.AddLine(buffer); buffer.Printf("%s=%s", KEY_IRCDDB_PASSWORD4.c_str(), m_ircddbPassword4.c_str()); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_APRS_ENABLED.c_str(), m_aprsEnabled ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%s"), KEY_APRS_HOSTNAME.c_str(), m_aprsHostname.c_str()); file.AddLine(buffer); + buffer.Printf(wxT("%s=%s"), KEY_APRS_ADDRESS.c_str(), m_aprsAddress.c_str()); file.AddLine(buffer); buffer.Printf(wxT("%s=%u"), KEY_APRS_PORT.c_str(), m_aprsPort); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_DEXTRA_ENABLED.c_str(), m_dextraEnabled ? 1 : 0); file.AddLine(buffer); buffer.Printf(wxT("%s=%u"), KEY_DEXTRA_MAXDONGLES.c_str(), m_dextraMaxDongles); file.AddLine(buffer); @@ -2574,7 +2599,6 @@ bool CIRCDDBGatewayConfig::write() buffer.Printf(wxT("%s=%d"), KEY_CCS_ENABLED.c_str(), m_ccsEnabled ? 1 : 0); file.AddLine(buffer); buffer.Printf(wxT("%s=%s"), KEY_CCS_HOST.c_str(), m_ccsHost.c_str()); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_XLX_ENABLED.c_str(), m_xlxEnabled ? 1 : 0); file.AddLine(buffer); - buffer.Printf(wxT("%s=%d"), KEY_XLX_OVERRIDE_LOCAL.c_str(), m_xlxOverrideLocal ? 1 : 0); file.AddLine(buffer); buffer.Printf(wxT("%s=%s"), KEY_XLX_HOSTS_FILE_URL.c_str(), m_xlxHostsFileUrl.c_str()); file.AddLine(buffer); buffer.Printf(wxT("%s=%s"), KEY_STARNET_BAND1.c_str(), m_starNet1Band.c_str()); file.AddLine(buffer); buffer.Printf(wxT("%s=%s"), KEY_STARNET_CALLSIGN1.c_str(), m_starNet1Callsign.c_str()); file.AddLine(buffer); @@ -2635,6 +2659,9 @@ bool CIRCDDBGatewayConfig::write() buffer.Printf(wxT("%s=%d"), KEY_LOG_ENABLED.c_str(), m_logEnabled ? 1 : 0); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_DRATS_ENABLED.c_str(), m_dratsEnabled ? 1 : 0); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_DTMF_ENABLED.c_str(), m_dtmfEnabled ? 1 : 0); file.AddLine(buffer); + buffer.Printf(wxT("%s=%d"), KEY_GPSD_ENABLED.c_str(), m_gpsdEnabled ? 1 : 0); file.AddLine(buffer); + buffer.Printf(wxT("%s=%s"), KEY_GPSD_ADDRESS.c_str(), m_gpsdAddress.c_str()); file.AddLine(buffer); + buffer.Printf(wxT("%s=%s"), KEY_GPSD_PORT.c_str(), m_gpsdPort.c_str()); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_WINDOW_X.c_str(), m_x); file.AddLine(buffer); buffer.Printf(wxT("%s=%d"), KEY_WINDOW_Y.c_str(), m_y); file.AddLine(buffer); @@ -2649,3 +2676,4 @@ bool CIRCDDBGatewayConfig::write() return true; } + diff --git a/Common/IRCDDBGatewayConfig.h b/Common/IRCDDBGatewayConfig.h index f1c8ca2..c97eab6 100644 --- a/Common/IRCDDBGatewayConfig.h +++ b/Common/IRCDDBGatewayConfig.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2014,2018,2020 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 @@ -49,18 +49,18 @@ public: void getRepeater4(wxString& callsign, wxString& band, HW_TYPE& type, wxString& address, unsigned int& port, unsigned char& band1, unsigned char& band2, unsigned char& band3, wxString& reflector, bool& atStartup, RECONNECT& reconnect, double& frequency, double& offset, double& range, double& latitude, double& longitude, double& agl, wxString& description1, wxString& description2, wxString& url) const; void setRepeater4(const wxString& band, HW_TYPE type, const wxString& address, unsigned int port, unsigned char band1, unsigned char band2, unsigned char band3, const wxString& reflector, bool atStartup, RECONNECT reconnect, double frequency, double offset, double range, double latitude, double longitude, double agl, const wxString& description1, const wxString& description2, const wxString& url); - void getIrcDDB(bool& enabled, wxString& hostname, wxString& username, wxString& password) const; + void getIrcDDB1(bool& enabled, wxString& hostname, wxString& username, wxString& password) const; void getIrcDDB2(bool& enabled, wxString& hostname, wxString& username, wxString& password) const; void getIrcDDB3(bool& enabled, wxString& hostname, wxString& username, wxString& password) const; void getIrcDDB4(bool& enabled, wxString& hostname, wxString& username, wxString& password) const; - void setIrcDDB(bool enabled, const wxString& hostname, const wxString& username, const wxString& password); + void setIrcDDB1(bool enabled, const wxString& hostname, const wxString& username, const wxString& password); void setIrcDDB2(bool enabled, const wxString& hostname, const wxString& username, const wxString& password); void setIrcDDB3(bool enabled, const wxString& hostname, const wxString& username, const wxString& password); void setIrcDDB4(bool enabled, const wxString& hostname, const wxString& username, const wxString& password); - void getDPRS(bool& enabled, wxString& hostname, unsigned int& port) const; - void setDPRS(bool enabled, const wxString& hostname, unsigned int port); + void getDPRS(bool& enabled, wxString& address, unsigned int& port) const; + void setDPRS(bool enabled, const wxString& address, unsigned int port); void getDExtra(bool& enabled, unsigned int& maxDongles) const; void setDExtra(bool enabled, unsigned int maxDongles); @@ -71,8 +71,8 @@ public: void getDCS(bool& dcsEnabled, bool& ccsEnabled, wxString& ccsHost) const; void setDCS(bool dcsEnabled, bool ccsEnabled, const wxString& ccsHost); - void getXLX(bool& xlxEnabled, bool& xlxOverrideLocal, wxString& xlxHostsFileUrl); - void setXLX(bool xlxEnabled, bool xlxOverrideLocal, wxString xlxHostsFileUrl); + void getXLX(bool& xlxEnabled, wxString& xlxHostsFileUrl); + void setXLX(bool xlxEnabled, wxString xlxHostsFileUrl); #if defined(DEXTRA_LINK) || defined(DCS_LINK) void getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const; @@ -112,6 +112,9 @@ public: void getMiscellaneous(TEXT_LANG& language, bool& infoEnabled, bool& echoEnabled, bool& logEnabled, bool& dratsEnabled, bool& dtmfEnabled) const; void setMiscellaneous(TEXT_LANG language, bool infoEnabled, bool echoEnabled, bool logEnabled, bool dratsEnabled, bool dtmfEnabled); + void getGPSD(bool& enabled, wxString& address, wxString& port) const; + void setGPSD(bool enabled, const wxString& address, const wxString& port); + void getPosition(int& x, int& y) const; void setPosition(int x, int y); @@ -215,10 +218,10 @@ private: unsigned char m_repeater4Band1; unsigned char m_repeater4Band2; unsigned char m_repeater4Band3; - bool m_ircddbEnabled; - wxString m_ircddbHostname; - wxString m_ircddbUsername; - wxString m_ircddbPassword; + bool m_ircddbEnabled1; + wxString m_ircddbHostname1; + wxString m_ircddbUsername1; + wxString m_ircddbPassword1; bool m_ircddbEnabled2; wxString m_ircddbHostname2; wxString m_ircddbUsername2; @@ -232,7 +235,7 @@ private: wxString m_ircddbUsername4; wxString m_ircddbPassword4; bool m_aprsEnabled; - wxString m_aprsHostname; + wxString m_aprsAddress; unsigned int m_aprsPort; bool m_dextraEnabled; unsigned int m_dextraMaxDongles; @@ -304,6 +307,9 @@ private: bool m_logEnabled; bool m_dratsEnabled; bool m_dtmfEnabled; + bool m_gpsdEnabled; + wxString m_gpsdAddress; + wxString m_gpsdPort; int m_x; int m_y; }; diff --git a/Common/Logger.cpp b/Common/Logger.cpp index 8edd3b1..6aa789b 100644 --- a/Common/Logger.cpp +++ b/Common/Logger.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002,2003,2009,2011,2012,2018 by Jonathan Naylor G4KLX + * Copyright (C) 2002,2003,2009,2011,2012,2019 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 @@ -19,20 +19,17 @@ #include "Logger.h" CLogger::CLogger(const wxString& directory, const wxString& name) : -#if(defined(__WINDOWS__)) -m_day(0), -#endif wxLog(), m_name(name), m_file(NULL), -m_fileName() +m_fileName(), +m_day(0) { m_file = new wxFFile; m_fileName.SetPath(directory); m_fileName.SetExt(wxT("log")); -#if(defined(__WINDOWS__)) time_t timestamp; ::time(×tamp); struct tm* tm = ::gmtime(×tamp); @@ -42,9 +39,6 @@ m_fileName() m_day = tm->tm_yday; m_fileName.SetName(text); -#else - m_fileName.SetName(m_name); -#endif bool ret = m_file->Open(m_fileName.GetFullPath(), wxT("a+t")); if (!ret) { @@ -85,18 +79,18 @@ void CLogger::DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogReco wxString message; message.Printf(wxT("%s: %04d-%02d-%02d %02d:%02d:%02d: %s\n"), letter.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, msg.c_str()); - logString(message, info.timestamp); + writeLog(message.c_str(), info.timestamp); if (level == wxLOG_FatalError) ::abort(); } -void CLogger::logString(const wxString& msg, time_t timestamp) +void CLogger::writeLog(const wxChar* msg, time_t timestamp) { wxASSERT(m_file != NULL); wxASSERT(m_file->IsOpened()); + wxASSERT(msg != NULL); -#if(defined(__WINDOWS__)) struct tm* tm = ::gmtime(×tamp); int day = tm->tm_yday; @@ -115,8 +109,8 @@ void CLogger::logString(const wxString& msg, time_t timestamp) return; } } -#endif - m_file->Write(msg); + m_file->Write(wxString(msg)); m_file->Flush(); } + diff --git a/Common/Logger.h b/Common/Logger.h index 0d082f0..b9ca2c2 100644 --- a/Common/Logger.h +++ b/Common/Logger.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002,2003,2009,2011,2012,2018 by Jonathan Naylor G4KLX + * Copyright (C) 2002,2003,2009,2011,2012,2019 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 @@ -22,7 +22,6 @@ #include #include #include -#include class CLogger : public wxLog { public: @@ -35,11 +34,10 @@ private: wxString m_name; wxFFile* m_file; wxFileName m_fileName; -#if(defined(__WINDOWS__)) int m_day; -#endif - void logString(const wxString& msg, time_t timestamp); + void writeLog(const wxChar* msg, time_t timestamp); }; #endif + diff --git a/Common/Makefile b/Common/Makefile index 8643148..b684c8d 100644 --- a/Common/Makefile +++ b/Common/Makefile @@ -1,22 +1,28 @@ -OBJECTS = AMBEData.o AnnouncementUnit.o APRSCollector.o APRSWriter.o APRSWriterThread.o AudioUnit.o CacheManager.o CallsignList.o \ - CallsignServer.o CCITTChecksum.o CCSData.o CCSHandler.o CCSProtocolHandler.o ConnectData.o DCSHandler.o DCSProtocolHandler.o \ +OBJECTS = AMBEData.o AnnouncementUnit.o APRSCollector.o APRSWriter.o AudioUnit.o CacheManager.o CallsignList.o \ + CallsignServer.o CCITTChecksum.o CCSData.o CCSHandler.o CCSProtocolHandler.o ConnectData.o ConsoleLogger.o DCSHandler.o DCSProtocolHandler.o \ DCSProtocolHandlerPool.o DDData.o DDHandler.o DExtraHandler.o DExtraProtocolHandler.o DExtraProtocolHandlerPool.o \ DPlusAuthenticator.o DPlusHandler.o DPlusProtocolHandler.o DPlusProtocolHandlerPool.o DRATSServer.o DTMF.o \ DummyRepeaterProtocolHandler.o DVTOOLFileReader.o EchoUnit.o G2Handler.o G2ProtocolHandler.o GatewayCache.o \ HBRepeaterProtocolHandler.o HeaderData.o HeaderLogger.o HeardData.o HostFile.o IcomRepeaterProtocolHandler.o IRCDDBGatewayConfig.o \ - LogEvent.o Logger.o PollData.o RemoteHandler.o RemoteLinkData.o RemoteProtocolHandler.o RemoteRepeaterData.o RemoteStarNetGroup.o \ + LogEvent.o Logger.o NatTraversalHandler.o PollData.o RemoteHandler.o RemoteLinkData.o RemoteProtocolHandler.o RemoteRepeaterData.o RemoteStarNetGroup.o \ RemoteStarNetUser.o RepeaterCache.o RepeaterHandler.o SHA256.o SlowDataEncoder.o StarNetHandler.o StatusData.o \ TCPReaderWriterClient.o TCPReaderWriterServer.o TextCollector.o TextData.o Timer.o UDPReaderWriter.o UserCache.o Utils.o \ VersionUnit.o XLXHostsFileDownloader.o +.PHONY: all all: Common.a -Common.a: $(OBJECTS) +Common.a: $(OBJECTS) ../ircDDB/IRCDDB.a $(AR) rcs Common.a $(OBJECTS) +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../ircDDB -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../ircDDB $< > $*.d +.PHONY: clean clean: $(RM) Common.a *.o *.d *.bak *~ +../ircDDB/IRCDDB.a: diff --git a/Common/NatTraversalHandler.cpp b/Common/NatTraversalHandler.cpp new file mode 100644 index 0000000..8ee9ac0 --- /dev/null +++ b/Common/NatTraversalHandler.cpp @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2010,2011,2012,2013,2014,2015,2016,2017,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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#if defined(ENABLE_NAT_TRAVERSAL) + +#include "NatTraversalHandler.h" + +const unsigned int CACHE_SIZE = 500U; + +CNatTraversalHandler::CNatTraversalHandler() : +m_g2cache(CACHE_SIZE), +m_g2Handler(NULL) +{ + +} + +CNatTraversalHandler::~CNatTraversalHandler() +{ + for (CNatTraversalCache_t::iterator it = m_g2cache.begin(); it != m_g2cache.end(); ++it) + delete it->second; +} + +void CNatTraversalHandler::setG2Handler(CG2ProtocolHandler * handler) +{ + m_g2Handler = handler; +} + +void CNatTraversalHandler::traverseNatG2(const wxString& address) +{ + if(m_g2Handler != NULL){ + CNatTraversalRecord* record = m_g2cache[address]; + + if(record == NULL) { + record = new CNatTraversalRecord(address); + m_g2cache[address] = record; + } + + std::time_t currentTime = std::time(NULL); + if(currentTime - record->getTimestamp() > G2_TRAVERSAL_TIMEOUT) { + record->setTimestamp(currentTime); + m_g2Handler->traverseNat(address); + } + } +} + +#endif \ No newline at end of file diff --git a/Common/NatTraversalHandler.h b/Common/NatTraversalHandler.h new file mode 100644 index 0000000..0069fea --- /dev/null +++ b/Common/NatTraversalHandler.h @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2010,2011,2012,2013,2014,2015,2016,2017,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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#if defined(ENABLE_NAT_TRAVERSAL) +#ifndef NatTraversalHandler_H +#define NatTraversalHandler_H + +#define G2_TRAVERSAL_TIMEOUT 29 //seconds + +#include "G2ProtocolHandler.h" + +#include +#include + +enum NAT_TRAVERSAL_TYPE { + NTT_G2, + //NTT_DEXTRA + //NTT_DCS + //NTT_DPLUS +}; + +class CNatTraversalRecord { +public: + CNatTraversalRecord(const wxString& address) : + m_address(address), + m_timestamp(0) + { + } + + std::time_t getTimestamp() const + { + return m_timestamp; + } + + void setTimestamp(std::time_t timestamp) + { + m_timestamp = timestamp; + } + +private: + wxString m_address; + std::time_t m_timestamp; +}; + +WX_DECLARE_STRING_HASH_MAP(CNatTraversalRecord*, CNatTraversalCache_t); + +/* +* This keeps track of when we UDP punched to one destination so to avoid unnecessary traffic on each ircddb reporting +*/ +class CNatTraversalHandler { +public: + CNatTraversalHandler(); + ~CNatTraversalHandler(); + + void setG2Handler(CG2ProtocolHandler* handler); + void traverseNatG2(const wxString& address); + +private: + CNatTraversalCache_t m_g2cache; + CG2ProtocolHandler* m_g2Handler; +}; + +#endif + +#endif \ No newline at end of file diff --git a/Common/RepeaterHandler.cpp b/Common/RepeaterHandler.cpp index 497c4c7..6f883fb 100644 --- a/Common/RepeaterHandler.cpp +++ b/Common/RepeaterHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2019 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 @@ -95,6 +95,7 @@ m_flag1(0x00U), m_flag2(0x00U), m_flag3(0x00U), m_restricted(false), +m_fastData(false), m_frames(0U), m_silence(0U), m_errors(0U), @@ -582,6 +583,9 @@ void CRepeaterHandler::processRepeater(CHeaderData& header) m_silence = 0U; m_errors = 0U; + // Assume voice mode + m_fastData = false; + // An RF header resets the reconnect timer m_linkReconnectTimer.start(); @@ -594,7 +598,7 @@ void CRepeaterHandler::processRepeater(CHeaderData& header) // Reset the APRS Writer if it's enabled if (m_aprsWriter != NULL) - m_aprsWriter->reset(m_rptCallsign); + m_aprsWriter->writeHeader(m_rptCallsign, header); // Write to Header.log if it's enabled if (m_headerLogger != NULL) @@ -736,32 +740,42 @@ void CRepeaterHandler::processRepeater(CAMBEData& data) unsigned char buffer[DV_FRAME_MAX_LENGTH_BYTES]; data.getData(buffer, DV_FRAME_MAX_LENGTH_BYTES); - if (::memcmp(buffer, NULL_AMBE_DATA_BYTES, VOICE_FRAME_LENGTH_BYTES) == 0) - m_silence++; + // Check for the fast data signature + if (!m_fastData) { + unsigned char slowDataType = (buffer[VOICE_FRAME_LENGTH_BYTES] ^ SCRAMBLER_BYTE1) & SLOW_DATA_TYPE_MASK; + if (slowDataType == SLOW_DATA_TYPE_FAST_DATA1 || slowDataType == SLOW_DATA_TYPE_FAST_DATA2) + m_fastData = true; + } - // Don't do DTMF decoding or blanking if off and not on crossband either - if (m_dtmfEnabled && m_g2Status != G2_XBAND) { - bool pressed = m_dtmf.decode(buffer, data.isEnd()); - if (pressed) { - // Replace the DTMF with silence - ::memcpy(buffer, NULL_AMBE_DATA_BYTES, VOICE_FRAME_LENGTH_BYTES); - data.setData(buffer, DV_FRAME_LENGTH_BYTES); - } + // Don't do AMBE processing when in Fast Data mode + if (!m_fastData) { + if (::memcmp(buffer, NULL_AMBE_DATA_BYTES, VOICE_FRAME_LENGTH_BYTES) == 0) + m_silence++; - bool dtmfDone = m_dtmf.hasCommand(); - if (dtmfDone) { - wxString command = m_dtmf.translate(); + // Don't do DTMF decoding or blanking if off and not on crossband either + if (m_dtmfEnabled && m_g2Status != G2_XBAND) { + bool pressed = m_dtmf.decode(buffer, data.isEnd()); + if (pressed) { + // Replace the DTMF with silence + ::memcpy(buffer, NULL_AMBE_DATA_BYTES, VOICE_FRAME_LENGTH_BYTES); + data.setData(buffer, DV_FRAME_LENGTH_BYTES); + } - // Only process the DTMF command if the your call is CQCQCQ and not a restricted user - if (!m_restricted && m_yourCall.Left(4U).IsSameAs(wxT("CQCQ"))) { - if (command.IsEmpty()) { - // Do nothing - } else if (isCCSCommand(command)) { - ccsCommandHandler(command, m_myCall1, wxT("DTMF")); - } else if (command.IsSameAs(wxT(" I"))) { - m_infoNeeded = true; - } else { - reflectorCommandHandler(command, m_myCall1, wxT("DTMF")); + bool dtmfDone = m_dtmf.hasCommand(); + if (dtmfDone) { + wxString command = m_dtmf.translate(); + + // Only process the DTMF command if the your call is CQCQCQ and not a restricted user + if (!m_restricted && m_yourCall.Left(4U).IsSameAs(wxT("CQCQ"))) { + if (command.IsEmpty()) { + // Do nothing + } else if (isCCSCommand(command)) { + ccsCommandHandler(command, m_myCall1, wxT("DTMF")); + } else if (command.IsSameAs(wxT(" I"))) { + m_infoNeeded = true; + } else { + reflectorCommandHandler(command, m_myCall1, wxT("DTMF")); + } } } } diff --git a/Common/RepeaterHandler.h b/Common/RepeaterHandler.h index 5871775..05baca2 100644 --- a/Common/RepeaterHandler.h +++ b/Common/RepeaterHandler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,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 @@ -208,6 +208,7 @@ private: unsigned char m_flag2; unsigned char m_flag3; bool m_restricted; + bool m_fastData; // Statistics unsigned int m_frames; 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/Common/Version.h b/Common/Version.h index 9138fe5..477d0c1 100644 --- a/Common/Version.h +++ b/Common/Version.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015,2018 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2019,2020 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 @@ -24,9 +24,9 @@ const wxString VENDOR_NAME = wxT("G4KLX"); #if defined(__WXDEBUG__) -const wxString VERSION = wxT("20180509 - DEBUG"); +const wxString VERSION = wxT("20200621 - DEBUG"); #else -const wxString VERSION = wxT("20180509"); +const wxString VERSION = wxT("20190621"); #endif #endif diff --git a/Common/XLXHostsFileDownloader.cpp b/Common/XLXHostsFileDownloader.cpp index bcf86de..869ddd0 100644 --- a/Common/XLXHostsFileDownloader.cpp +++ b/Common/XLXHostsFileDownloader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013,2015 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2013,2015,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 @@ -28,6 +28,8 @@ wxString CXLXHostsFileDownloader::Download(const wxString & xlxHostsFileURL) { #ifdef XLX_USE_WGET + wxLogMessage(_T("Downloading XLX reflector list from %s"), xlxHostsFileURL.c_str()); + wxString xlxHostsFileName = wxFileName::CreateTempFileName(_T("XLX_Hosts_")); wxString commandLine = _T("wget -q -O ") + xlxHostsFileName + _T(" ") + xlxHostsFileURL; bool execResult = wxShell(commandLine); @@ -64,8 +66,8 @@ wxString CXLXHostsFileDownloader::Download(const wxString & xlxHostsFileURL) return wxEmptyString; } - wxInputStream* in = NULL; - if((in = http.GetInputStream(path)) && in->IsOk()) { + wxInputStream* in = http.GetInputStream(path); + if(in != NULL && in->IsOk()) { wxFile file; wxString xlxHostsFileName = wxFileName::CreateTempFileName(_T("XLX_Hosts_"), &file); wxLogMessage(_T("Created temporary file %s"), xlxHostsFileName); diff --git a/Common/XLXHostsFileDownloader.h b/Common/XLXHostsFileDownloader.h index 7fba376..b7212a9 100644 --- a/Common/XLXHostsFileDownloader.h +++ b/Common/XLXHostsFileDownloader.h @@ -19,9 +19,13 @@ #ifndef XLXHostsFileDownloader_H #define XLXHostsFileDownloader_H -#define XLX_USE_WGET + #include +#if !defined (__WINDOWS__) +#define XLX_USE_WGET //for some reason libwx is missing the net stuff on some distros, therefore always use wget if we are not compiling under windows +#endif + class CXLXHostsFileDownloader { public: static wxString Download(const wxString & xlxHostsFileURL); diff --git a/Data/DCS_Hosts.txt b/Data/DCS_Hosts.txt index 1d3667d..f4da4f2 100644 --- a/Data/DCS_Hosts.txt +++ b/Data/DCS_Hosts.txt @@ -1,244 +1,467 @@ -DCS000 206.208.56.92 -DCS001 dcs001.xreflector.net -DCS002 dcs002.xreflector.net -DCS003 dcs003.xreflector.net -DCS004 dcs004.xreflector.net -DCS005 www.bm-dmr.uk -DCS006 dcs006.xreflector.net -DCS007 dcs007.xreflector.net -DCS008 dcs008.xreflector.net -DCS009 dcs009.xreflector.net -DCS010 dcs010.xreflector.net -DCS011 dcs011.xreflector.net -DCS012 dcs012.xreflector.net -DCS013 dcs013.xreflector.net -DCS014 dcs014.xreflector.net -DCS015 dcs015.xreflector.net -DCS016 dcs016.xreflector.net -DCS017 dcs017.xreflector.net -DCS018 dcs018.xreflector.net -DCS019 dcs019.xreflector.net -DCS021 dcs021.xreflector.net -DCS022 dcs022.xreflector.net -DCS023 dcs023.xreflector.net -DCS024 dcs024.xreflector.net -DCS025 dcs025.xreflector.net -DCS026 dcs026.xreflector.net -DCS027 dcs027.xreflector.net -DCS028 xlx028.org L -DCS029 dcs029.xreflector.net -DCS032 dcs032.xreflector.net -DCS033 dcs033.xreflector.net -DCS035 45.79.94.184 -DCS039 185.203.118.66 -DCS040 109.71.45.29 -DCS041 45.62.226.137 -DCS044 dcs044.xreflector.net -DCS045 64.137.172.60 -DCS046 176.10.140.161 -DCS047 121.94.218.243 -DCS050 212.237.17.133 -DCS051 93.186.254.219 -DCS052 60.47.177.125 -DCS054 52.86.180.251 -DCS055 52.80.4.154 -DCS057 74.193.209.20 -DCS058 118.236.151.192 -DCS060 212.237.36.181 -DCS061 68.115.205.110 -DCS062 70.88.145.163 -DCS064 202.241.175.133 -DCS066 79.16.44.125 -DCS068 92.222.145.202 -DCS069 89.36.214.120 -DCS071 211.60.41.185 -DCS072 211.60.41.186 -DCS075 5.135.162.136 -DCS076 203.137.116.117 -DCS077 5.249.151.111 -DCS078 109.10.128.221 -DCS079 121.162.91.94 -DCS080 121.85.180.61 -DCS081 121.84.13.151 -DCS082 108.21.232.21 -DCS083 108.21.232.22 -DCS085 27.92.11.123 -DCS086 220.133.89.28 -DCS087 44.137.36.209 -DCS088 194.109.192.235 -DCS089 194.109.192.236 -DCS090 91.92.136.252 -DCS092 94.177.190.50 -DCS093 98.29.99.252 -DCS095 58.1.93.223 -DCS098 111.168.216.126 -DCS099 212.237.59.103 -DCS100 96.94.7.196 -DCS101 104.233.105.86 -DCS102 206.208.56.13 -DCS103 64.137.248.42 -DCS104 206.208.56.93 -DCS111 81.95.126.168 -DCS112 216.45.55.151 -DCS114 91.121.136.94 -DCS115 217.182.128.3 -DCS116 31.185.101.211 -DCS118 5.249.148.252 -DCS119 125.129.207.86 -DCS120 24.43.83.140 -DCS121 174.37.249.156 -DCS124 211.14.169.234 -DCS125 213.181.208.52 -DCS127 190.112.228.107 -DCS128 153.249.96.5 -DCS145 178.59.23.138 -DCS146 87.228.241.43 -DCS147 46.41.1.127 -DCS150 212.237.3.87 -DCS170 210.178.113.173 -DCS171 121.162.91.45 -DCS185 118.152.21.76 -DCS204 185.85.18.162 -DCS206 193.190.240.227 -DCS208 151.80.155.39 -DCS210 45.62.210.243 -DCS212 52.38.90.188 -DCS214 185.47.129.230 -DCS216 74.214.25.135 -DCS222 93.189.136.50 -DCS227 86.122.173.9 -DCS228 212.237.33.114 -DCS230 80.250.3.114 -DCS232 213.47.219.169 -DCS241 151.80.158.227 -DCS242 73.14.84.43 -DCS246 172.93.48.159 -DCS248 158.69.206.45 -DCS252 118.21.66.186 -DCS255 245.115.35.52 -DCS261 44.144.0.23 -DCS262 44.144.0.24 -DCS264 52.2.131.118 -DCS265 51.255.43.60 -DCS270 158.64.26.132 -DCS291 60.112.168.104 -DCS295 45.62.238.78 -DCS298 133.208.206.141 -DCS299 125.236.227.43 -DCS300 64.137.172.56 -DCS302 144.217.241.23 -DCS307 104.36.40.243 -DCS310 64.137.165.141 -DCS311 78.47.206.12 -DCS313 xlx313.openstd.net -DCS317 44.48.8.15 -DCS321 31.207.110.231 -DCS333 194.116.29.73 -DCS334 199.119.98.174 -DCS336 23.226.233.133 -DCS339 198.98.53.247 -DCS357 52.39.82.54 -DCS359 79.232.250.96 -DCS365 59.139.141.204 -DCS370 188.213.168.24 -DCS373 101.143.24.88 -DCS382 61.116.7.187 -DCS389 106.71.106.79 -DCS390 31.14.140.230 -DCS398 45.62.243.153 -DCS404 91.229.143.187 -DCS412 42.151.104.175 -DCS433 217.160.22.17 -DCS440 114.176.44.90 -DCS441 203.137.99.110 -DCS444 188.68.37.51 -DCS450 64.137.161.11 -DCS486 51.255.172.249 -DCS499 59.157.4.151 -DCS500 172.104.32.192 -DCS502 74.208.88.137 -DCS515 163.44.167.125 -DCS518 176.9.1.168 -DCS519 24.55.202.247 -DCS520 202.6.18.14 -DCS538 133.137.49.171 -DCS550 151.80.141.175 -DCS555 64.137.186.11 -DCS569 219.122.146.110 -DCS570 104.128.230.153 -DCS573 216.189.148.204 -DCS595 219.104.19.203 -DCS600 13.69.14.204 -DCS601 51.141.52.193 -DCS602 212.56.100.200 -DCS603 24.233.107.8 -DCS610 103.1.213.21 -DCS616 44.103.39.7 -DCS626 202.137.244.157 -DCS666 54.144.216.63 -DCS689 97.107.128.47 -DCS699 82.102.5.239 -DCS700 78.47.222.93 -DCS706 93.186.255.126 -DCS707 90.145.156.196 -DCS708 202.218.37.62 -DCS709 212.237.34.32 -DCS711 212.237.18.27 -DCS712 153.227.250.188 -DCS714 85.214.119.76 -DCS724 191.232.36.180 -DCS737 195.130.75.246 -DCS746 178.254.34.44 -DCS747 93.209.43.173 -DCS748 64.137.197.36 -DCS750 203.86.206.49 -DCS751 210.55.201.126 -DCS755 193.248.45.246 -DCS766 201.62.48.61 -DCS773 94.177.175.230 -DCS777 45.62.251.163 -DCS781 175.179.238.153 -DCS787 87.154.55.113 -DCS789 75.144.65.122 -DCS800 52.26.26.195 -DCS801 77.117.160.175 -DCS807 118.8.17.123 -DCS812 126.25.168.252 -DCS813 97.76.81.165 -DCS850 88.198.94.77 -DCS870 103.3.234.95 -DCS880 176.10.105.211 -DCS886 118.163.103.178 -DCS887 118.163.103.177 -DCS888 31.14.135.7 -DCS897 92.222.23.124 -DCS900 85.214.114.27 -DCS901 77.117.160.175 -DCS906 212.237.11.53 -DCS908 212.237.2.183 -DCS909 216.86.147.198 -DCS910 94.177.207.26 -DCS911 5.196.73.89 -DCS921 44.143.184.83 -DCS929 158.69.166.132 -DCS930 94.177.160.5 -DCS931 173.50.88.34 -DCS933 37.59.119.115 -DCS940 202.218.37.121 -DCS950 158.64.26.134 -DCS960 80.211.226.89 -DCS964 52.173.142.244 -DCS967 95.158.165.32 -DCS972 46.121.158.50 -DCS974 94.177.217.52 -DCS975 176.31.161.9 -DCS976 212.237.36.71 -DCS978 193.70.0.229 -DCS986 81.89.102.160 -DCS987 185.32.183.148 -DCS989 xrf989.bbhill.net -DCS990 35.164.237.63 -DCS995 142.116.255.245 -DCS997 94.177.187.40 -DCS998 44.140.236.20 -DCS999 94.177.173.53 +# Prepared at ar-dns.net - Sun, 19 May 2019 12:38:05 GMT +DCS000 23.111.174.198 +DCS001 dcs001.xreflector.net +DCS002 dcs002.xreflector.net +DCS003 dcs003.xreflector.net +DCS004 dcs004.xreflector.net +DCS005 dcs.bm-dmr.uk +DCS006 dcs006.xreflector.net +DCS006 146.168.196.187 +DCS007 dcs007.xreflector.net +DCS008 dcs008.xreflector.net +DCS009 dcs009.xreflector.net +DCS010 85.197.129.86 +DCS010 dcs010.xreflector.net +DCS011 dcs011.xreflector.net +DCS012 194.38.140.205 +DCS012 dcs012.xreflector.net +DCS013 dcs013.xreflector.net +DCS014 dcs014.xreflector.net +DCS015 dcs015.xreflector.net +DCS016 dcs016.xreflector.net +DCS017 dcs017.xreflector.net +DCS018 dcs018.xreflector.net +DCS019 dcs019.xreflector.net +DCS020 3.208.40.45 +DCS021 dcs021.xreflector.net +DCS022 dcs022.xreflector.net +DCS023 dcs023.xreflector.net +DCS024 dcs024.xreflector.net +DCS025 dcs025.xreflector.net +DCS026 dcs026.xreflector.net +DCS027 dcs027.xreflector.net +DCS028 xlx028.org +DCS029 dcs029.xreflector.net +DCS030 194.59.177.44 +DCS032 dcs032.xreflector.net +DCS033 dcs033.xreflector.net +DCS035 45.79.94.184 +DCS036 151.12.36.112 +DCS038 5.249.151.111 +DCS039 31.14.142.119 +DCS040 109.71.45.29 +DCS041 45.62.226.137 +DCS044 dcs044.xreflector.net +DCS045 64.137.172.60 +DCS046 176.10.140.161 +DCS047 202.171.147.58 +DCS049 212.71.234.224 +DCS050 80.211.155.206 +DCS051 93.186.254.219 +DCS052 121.116.69.175 +DCS053 5.133.99.12 +DCS054 52.86.180.251 +DCS055 52.80.4.154 +DCS057 74.193.217.15 +DCS058 150.66.16.176 +DCS059 18.219.32.21 +DCS060 212.237.36.181 +DCS061 208.71.169.83 +DCS062 72.17.20.173 +DCS064 122.222.1.50 +DCS066 79.55.195.190 +DCS067 95.60.130.176 +DCS068 92.222.145.202 +DCS069 89.36.214.120 +DCS071 211.60.41.185 +DCS072 75.60.237.17 +DCS073 114.224.6.211 +DCS074 212.237.211.82 +DCS075 5.135.162.136 +DCS076 203.137.116.117 +DCS077 216.21.9.156 +DCS078 109.15.57.11 +DCS079 121.162.91.31 +DCS080 121.81.128.207 +DCS081 121.82.151.243 +DCS082 110.232.113.108 +DCS083 185.205.210.217 +DCS084 45.79.93.167 +DCS085 113.150.26.8 +DCS086 52.80.139.252 +DCS087 44.137.36.209 +DCS088 194.109.192.235 +DCS089 194.109.192.236 +DCS090 91.92.136.252 +DCS092 104.200.25.53 +DCS093 185.177.59.221 +DCS095 203.137.76.53 +DCS097 80.211.154.173 +DCS098 203.136.233.165 +DCS099 80.211.27.75 +DCS100 45.62.234.223 +DCS101 64.137.236.164 +DCS102 23.111.174.196 +DCS103 64.137.224.126 +DCS104 23.111.174.197 +DCS105 51.254.99.78 +DCS109 115.179.53.132 +DCS110 150.7.164.10 +DCS111 61.195.96.160 +DCS112 94.177.235.81 +DCS113 151.12.36.103 +DCS114 5.135.188.16 +DCS115 217.182.128.3 +DCS116 31.185.101.211 +DCS118 5.249.148.252 +DCS119 125.129.207.86 +DCS120 81.150.10.63 +DCS121 174.37.249.156 +DCS122 83.137.45.126 +DCS124 211.14.169.234 +DCS125 213.181.208.52 +DCS127 190.112.228.107 +DCS128 153.248.144.11 +DCS129 111.64.166.200 +DCS130 194.59.177.45 +DCS131 80.127.118.226 +DCS132 91.203.55.87 +DCS134 159.89.176.86 +DCS135 74.208.214.69 +DCS140 95.211.211.145 +DCS142 44.168.48.8 +DCS145 178.59.23.138 +DCS146 213.7.197.202 +DCS147 46.41.1.127 +DCS150 80.211.10.212 +DCS153 210.189.104.236 +DCS155 18.235.96.93 +DCS158 150.66.16.176 +DCS160 61.195.109.179 +DCS170 210.178.113.173 +DCS171 210.178.113.123 +DCS175 162.248.92.25 +DCS180 192.241.240.7 +DCS185 89.106.108.151 +DCS190 190.194.12.53 +DCS199 153.126.179.214 +DCS200 185.203.119.158 +DCS202 148.251.122.251 +DCS204 85.214.126.111 +DCS206 193.190.240.227 +DCS208 151.80.155.39 +DCS210 64.137.224.107 +DCS212 52.38.90.188 +DCS214 185.47.129.230 +DCS215 185.87.96.172 +DCS216 74.214.25.135 +DCS220 124.41.83.11 +DCS222 212.43.96.84 +DCS224 203.137.99.97 +DCS226 2.226.183.226 +DCS227 89.33.44.100 +DCS228 85.6.171.146 +DCS229 194.191.4.54 +DCS230 80.250.3.114 +DCS232 89.185.97.35 +DCS235 5.150.254.97 +DCS238 172.104.239.219 +DCS241 151.80.158.227 +DCS242 73.14.84.43 +DCS246 172.93.48.159 +DCS255 142.91.158.199 +DCS257 47.157.82.87 +DCS258 75.60.237.19 +DCS261 44.144.0.23 +DCS262 87.139.70.67 +DCS263 85.214.193.146 +DCS264 52.2.131.118 +DCS265 212.237.51.82 +DCS266 212.237.51.82 +DCS268 194.38.140.204 +DCS270 158.64.26.132 +DCS272 177.194.25.234 +DCS274 75.115.207.48 +DCS280 87.19.134.242 +DCS282 210.188.25.17 +DCS284 95.158.165.32 +DCS285 91.92.93.15 +DCS287 43.245.172.2 +DCS288 121.75.75.200 +DCS290 44.182.7.20 +DCS291 101.143.242.189 +DCS295 45.62.224.93 +DCS298 122.131.152.80 +DCS299 203.86.194.92 +DCS300 45.62.247.43 +DCS302 144.217.241.23 +DCS303 75.70.52.143 +DCS305 145.239.116.57 +DCS307 72.21.76.154 +DCS310 52.11.207.121 +DCS311 46.41.0.214 +DCS312 192.241.160.183 +DCS313 34.213.108.164 +DCS315 65.101.7.50 +DCS317 44.48.8.15 +DCS321 31.207.110.45 +DCS328 212.237.33.114 +DCS329 114.181.139.32 +DCS330 18.222.199.205 +DCS332 188.213.168.99 +DCS333 194.116.29.73 +DCS334 96.47.95.121 +DCS335 185.206.145.2 +DCS336 23.226.233.133 +DCS338 122.116.216.47 +DCS339 198.98.53.247 +DCS345 45.62.237.34 +DCS352 35.230.162.146 +DCS357 93.152.167.4 +DCS358 93.152.167.4 +DCS359 94.156.172.213 +DCS360 222.229.25.105 +DCS364 159.65.231.53 +DCS365 59.139.141.204 +DCS367 xrf367.ad6dm.net +DCS367 18.216.66.72 +DCS370 188.213.168.24 +DCS371 212.237.8.77 +DCS373 119.229.134.1 +DCS374 61.195.108.146 +DCS376 75.145.119.225 +DCS377 186.159.96.100 +DCS379 104.218.36.162 +DCS380 160.16.65.39 +DCS382 211.131.3.119 +DCS388 138.197.67.52 +DCS389 106.71.212.36 +DCS389 xlxdmr.duckdns.org +DCS390 149.7.214.253 +DCS393 139.91.200.186 +DCS395 5.249.151.111 +DCS398 45.62.243.153 +DCS399 185.227.110.247 +DCS400 13.58.192.185 +DCS404 91.229.143.187 +DCS410 166.78.145.146 +DCS411 82.171.119.45 +DCS412 61.195.107.113 +DCS420 174.138.113.116 +DCS421 118.189.181.236 +DCS431 61.195.98.225 +DCS433 217.160.22.17 +DCS434 51.254.128.134 +DCS438 80.211.189.236 +DCS440 153.176.140.229 +DCS441 203.137.99.110 +DCS444 188.68.37.51 +DCS449 159.89.183.117 +DCS450 64.137.224.233 +DCS454 218.250.250.21 +DCS455 208.71.169.83 +DCS456 xrf456.de +DCS456 54.37.204.187 +DCS460 183.53.66.145 +DCS464 52.192.129.174 +DCS470 104.49.29.243 +DCS477 139.162.213.89 +DCS479 198.58.106.10 +DCS486 51.255.172.249 +DCS487 93.66.214.109 +DCS499 203.137.76.22 +DCS500 58.96.21.253 +DCS501 198.211.98.63 +DCS502 190.148.222.28 +DCS505 45.248.50.37 +DCS506 121.200.19.211 +DCS508 185.188.4.15 +DCS510 110.141.219.161 +DCS511 213.172.232.13 +DCS515 203.137.78.35 +DCS518 176.9.1.168 +DCS519 149.56.165.76 +DCS520 xlx.dtdxa.com +DCS521 150.129.184.54 +DCS522 14.102.146.160 +DCS523 175.142.199.32 +DCS525 80.211.68.38 +DCS530 116.251.193.99 +DCS534 208.71.169.83 +DCS538 131.129.217.94 +DCS544 202.218.152.66 +DCS550 89.36.222.146 +DCS551 140.227.198.45 +DCS553 45.79.92.86 +DCS554 52.35.183.178 +DCS555 xlx555.dtdxa.com +DCS567 212.91.156.69 +DCS569 203.137.111.98 +DCS570 172.104.13.31 +DCS573 216.189.148.204 +DCS583 116.70.240.104 +DCS587 68.32.126.21 +DCS595 220.146.24.34 +DCS599 203.137.118.190 +DCS600 13.69.14.204 +DCS601 51.141.52.193 +DCS602 212.56.100.200 +DCS603 216.246.155.99 +DCS604 139.162.241.24 +DCS605 183.76.179.238 +DCS608 219.122.253.83 +DCS609 219.122.253.83 +DCS610 89.186.80.81 +DCS613 198.50.202.39 +DCS619 167.99.168.82 +DCS626 45.77.234.162 +DCS627 121.75.75.200 +DCS630 61.195.125.81 +DCS634 222.148.104.64 +DCS647 217.182.168.54 +DCS651 198.96.90.144 +DCS655 146.64.235.19 +DCS666 86.153.215.35 +DCS672 180.27.223.252 +DCS673 180.147.243.178 +DCS684 212.237.17.83 +DCS689 97.107.128.47 +DCS695 155.254.33.145 +DCS698 203.137.123.89 +DCS699 82.102.5.239 +DCS700 2.29.27.21 +DCS701 61.195.107.77 +DCS703 61.195.98.254 +DCS704 150.66.34.110 +DCS706 93.186.255.126 +DCS707 90.145.156.196 +DCS708 150.66.20.222 +DCS709 212.237.34.32 +DCS711 212.237.18.27 +DCS712 153.215.181.34 +DCS713 218.251.63.99 +DCS714 81.169.140.163 +DCS717 44.137.70.100 +DCS722 80.211.2.161 +DCS723 45.33.118.112 +DCS724 xlx.dvbrazil.com.br +DCS724 75.99.228.35 +DCS725 172.245.9.180 +DCS730 190.14.50.165 +DCS732 190.159.68.105 +DCS733 45.56.117.158 +DCS734 181.208.254.236 +DCS735 104.131.81.32 +DCS737 195.130.75.246 +DCS738 210.171.151.238 +DCS740 104.167.114.230 +DCS741 203.137.78.41 +DCS746 178.254.34.44 +DCS747 93.209.44.227 +DCS748 64.137.197.36 +DCS749 45.77.102.203 +DCS750 203.86.206.49 +DCS751 203.118.145.79 +DCS752 66.154.105.195 +DCS755 178.22.148.229 +DCS757 43.229.63.42 +DCS762 129.21.36.65 +DCS766 201.62.48.61 +DCS768 80.211.199.231 +DCS770 153.126.173.9 +DCS773 89.46.75.166 +DCS775 149.202.61.17 +DCS776 182.168.37.205 +DCS777 194.182.66.76 +DCS781 101.143.242.199 +DCS782 153.221.123.92 +DCS787 46.41.1.96 +DCS788 192.168.0.96 +DCS789 45.33.119.142 +DCS794 101.143.242.95 +DCS800 87.252.188.119 +DCS801 213.47.71.17 +DCS803 77.117.21.251 +DCS806 92.107.25.23 +DCS807 153.167.124.196 +DCS808 18.220.252.27 +DCS809 78.46.11.69 +DCS810 71.41.121.228 +DCS811 64.137.238.189 +DCS812 203.145.233.141 +DCS813 97.76.81.165 +DCS817 18.235.96.93 +DCS818 120.79.155.116 +DCS825 51.75.252.197 +DCS828 195.225.116.244 +DCS833 78.226.112.146 +DCS844 137.226.79.122 +DCS847 162.243.4.29 +DCS850 88.198.94.77 +DCS852 42.2.140.44 +DCS858 54.227.203.214 +DCS859 54.227.203.214 +DCS860 24.134.86.93 +DCS861 66.175.218.63 +DCS865 45.32.212.226 +DCS866 93.233.182.237 +DCS867 51.254.115.5 +DCS870 103.3.234.95 +DCS871 182.245.190.200 +DCS878 203.137.123.113 +DCS880 176.10.105.211 +DCS883 153.179.224.224 +DCS886 118.163.103.178 +DCS887 118.163.103.177 +DCS888 46.18.142.169 +DCS889 130.149.36.93 +DCS893 104.223.59.212 +DCS897 212.237.2.183 +DCS900 94.177.237.192 +DCS903 80.211.29.226 +DCS904 211.14.169.215 +DCS906 212.237.11.53 +DCS907 176.84.63.187 +DCS908 92.222.23.124 +DCS909 216.86.147.198 +DCS910 94.177.207.26 +DCS911 xlx911.patrweb.com +DCS912 80.211.1.143 +DCS915 72.28.30.93 +DCS919 80.211.232.174 +DCS920 81.150.10.62 +DCS921 44.143.184.83 +DCS922 81.150.10.62 +DCS925 90.255.232.101 +DCS929 158.69.166.132 +DCS930 94.177.160.5 +DCS931 68.131.30.206 +DCS933 164.132.104.167 +DCS935 188.213.166.199 +DCS940 202.218.37.121 +DCS944 202.218.34.210 +DCS945 213.202.229.40 +DCS946 212.227.174.45 +DCS950 158.64.26.134 +DCS951 18.188.166.109 +DCS956 192.99.245.120 +DCS959 203.137.98.121 +DCS964 52.173.142.244 +DCS965 47.23.66.19 +DCS966 203.150.19.24 +DCS967 95.158.165.32 +DCS969 142.93.46.36 +DCS970 157.7.221.186 +DCS972 109.226.48.53 +DCS973 211.14.169.43 +DCS974 94.177.217.52 +DCS975 176.31.161.9 +DCS976 212.237.36.71 +DCS979 217.162.36.91 +DCS980 80.211.84.249 +DCS986 194.59.205.218 +DCS987 185.32.183.148 +DCS988 80.211.236.189 +DCS989 50.27.131.75 +DCS990 35.164.237.63 +DCS991 80.211.19.121 +DCS992 149.28.243.165 +DCS993 97.64.20.63 +DCS994 35.177.233.106 +DCS995 118.27.30.92 +DCS996 47.104.177.248 +DCS997 94.177.187.40 +DCS998 44.140.236.20 +DCS999 94.177.173.53 +DSC034 dcs034.xreflector.net +# EOF - Sun, 19 May 2019 12:38:05 GMT diff --git a/Data/DExtra_Hosts.txt b/Data/DExtra_Hosts.txt index 868212d..92f8d8c 100644 --- a/Data/DExtra_Hosts.txt +++ b/Data/DExtra_Hosts.txt @@ -1,200 +1,746 @@ -#>>Downloaded from W6KD host file server -#>>Last updated 17 NOV 2016 by W6KD - +# Prepared at ar-dns.net - Sun, 19 May 2019 12:35:55 GMT +XRF000 23.111.174.198 XRF000 000.xreflector.org +XRF001 77.57.24.143 XRF001 xlx001.homepc.it +XRF002 140.82.62.162 XRF002 xrf002.dstar.club -XRF003 xrf003.iw0red.it +XRF003 173.199.124.183 +XRF003 xlx003.xrefl.net +XRF004 44.103.34.3 XRF004 xrf004.kb8zgl.net -XRF005 216.16.240.236 +XRF005 50.116.62.225 +XRF005 ve3tnk.homelinux.net +XRF006 34.213.176.201 XRF006 xrf006.xrefl.net -XRF007 xrf007.ea5gf.es -XRF008 95.110.231.219 +XRF007 82.223.18.138 +XRF008 45.77.153.132 +XRF008 xrf008.kingsofdigital.net +XRF009 118.150.164.96 +XRF009 www.hamtalk.net +XRF010 85.197.129.86 XRF010 xlx010.n8qq.com -XRF011 xlx011.n8qq.com +XRF011 81.95.126.168 +XRF011 xlx011.warn.org +XRF012 52.26.161.5 XRF012 xrf012.papasys.com +XRF013 34.213.176.201 +XRF013 xrf013.perform2themax.com XRF014 xrf014.iz0rin.it +XRF015 194.59.205.228 XRF015 xrf015.theapplecore.me XRF016 xrf016.ampr.at -XRF018 99.167.129.166 -XRF019 66.30.81.236 -XRF020 67.210.212.144 -XRF021 44.103.32.250 -XRF022 xrf022.tms-it.net -XRF024 xrf024.dstar.at +XRF017 92.177.212.64 +XRF018 flatcap.badweather.net +XRF019 46.28.108.233 +XRF019 xlx019.ok2it.com +XRF020 xrf020.k2dls.net +XRF021 44.103.34.4 +XRF022 83.137.45.98 +XRF022 xrf022.tms-it.net +XRF023 185.177.59.166 +XRF023 xlx023.dtdns.net +XRF024 94.199.173.123 +XRF024 xrf024.dstar.at +XRF025 89.38.150.252 XRF025 025.ham-digital.es -XRF027 194.116.29.78 -XRF028 stn028.dstar.be +XRF026 65.175.188.230 +XRF027 194.116.29.78 +XRF028 172.104.63.79 +XRF028 stn028.dstar.be +XRF029 80.123.238.76 XRF029 xrf029.tms-it.net -XRF030 xrf030.oe3xht.at +XRF030 194.59.177.44 +XRF030 xrf030.oe3xht.at +XRF031 83.241.141.245 +XRF031 xlx031.ddns.net +XRF032 158.64.26.140 XRF032 xlx032.epf.lu -XRF033 46.226.178.81 +XRF033 46.226.178.81 +XRF034 xrf034.dynu.net +XRF035 45.79.94.184 XRF035 xrf035.wa7dre.org -XRF036 xrf036.ddns.net +XRF036 151.12.36.112 +XRF036 xlx036.macasoft.it XRF037 185.58.193.163 -XRF038 66.6.171.228 +XRF038 44.103.34.19 +XRF039 31.14.142.119 +XRF040 109.71.45.29 XRF040 xrf040.dyndns.org -XRF041 167.88.37.80 +XRF041 167.88.37.80 XRF042 xrf042.luthienstar.fr -XRF043 xrf043.aotnet.it -XRF044 82.1.185.173 +XRF043 xrf043.aotnet.it +XRF044 82.1.185.173 XRF045 45.62.233.223 +XRF046 176.10.140.161 XRF046 xlx.c4fm.se +XRF047 202.171.147.58 XRF047 xlx047.ddns.net +XRF048 xrf048.n5uxt.org +XRF049 212.71.234.224 +XRF050 80.211.155.206 +XRF050 dstar.emcomspain.xreflector.es +XRF051 93.186.254.219 +XRF052 121.119.96.205 XRF052 xrf052.dip.jp -XRF055 95.110.229.195 +XRF053 185.97.120.120 +XRF053 xlx.grvdc.eu +XRF054 52.86.180.251 +XRF054 xrf054.metro-uhf.org +XRF055 52.80.4.154 +XRF055 dstar.zzux.com +XRF056 xrf056.homepc.it +XRF057 74.193.217.15 +XRF057 xlx057.ddns.net +XRF058 133.208.235.3 +XRF058 xrf058.dip.jp +XRF059 18.219.32.21 +XRF060 212.237.36.181 XRF061 68.115.205.110 +XRF062 72.17.20.173 XRF062 xlx.maryland-dstar.net XRF063 162.248.141.148 +XRF064 122.222.1.50 XRF064 xrf064.owari.biz +XRF065 212.237.53.67 +XRF066 87.7.192.18 +XRF066 xlx066.homepc.it +XRF067 95.60.130.176 XRF067 xrf067.f5kav.org +XRF068 92.222.145.202 XRF068 xrf068.ircddb.it -XRF069 069.xreflector.es -XRF070 xrf070.iptime.org +XRF069 xrf069.sustrai.org +XRF070 xrf070.iptime.org +XRF071 211.60.41.185 XRF071 xrf.elechomebrew.com -XRF073 147.102.7.34 +XRF072 75.60.237.17 +XRF072 xrf072.dv.or.kr +XRF073 147.102.7.34 +XRF074 212.237.211.82 XRF074 xrf074.dyndns.org -XRF075 xrf075.ir9bs.it +XRF075 5.135.162.136 +XRF075 xrf075.ir9bs.it +XRF076 203.137.116.117 XRF076 xrf076.xreflector-jp.org +XRF077 216.21.9.156 XRF077 xrf077.duckdns.org -XRF078 xrf078.duckdns.org -XRF080 jr3vh.jpn.ph.jp -XRF081 ja3gqj.dip.jp -XRF084 xrf084.fabbroni.eu +XRF078 109.15.57.11 +XRF078 xlx.grvdc.eu +XRF079 184.23.183.98 +XRF079 xlx079.dvham.com +XRF080 121.81.128.207 +XRF080 jr3vh.dip.jp +XRF081 121.82.151.243 +XRF081 jr3vh.dip.jp +XRF082 110.232.113.108 +XRF082 xlx082.pungsan.com +XRF083 185.205.210.217 +XRF083 xlx083.pungsan.com +XRF084 45.79.93.167 +XRF085 113.150.26.8 XRF085 jr1ofp.dip.jp +XRF086 52.80.139.252 +XRF087 44.137.36.209 +XRF088 194.109.192.235 XRF088 xrf088.pa4tw.nl -XRF091 091.xreflector.es +XRF089 194.109.192.236 +XRF089 xlx089.pa4tw.nl +XRF090 91.92.136.252 +XRF091 89.36.219.197 +XRF092 104.200.25.53 +XRF093 185.177.59.221 +XRF094 157.7.221.186 +XRF095 203.137.76.53 +XRF095 xrf095.xreflector-jp.org +XRF097 80.211.154.173 +XRF098 203.136.233.165 XRF098 xrf098.dip.jp +XRF099 80.211.27.75 +XRF099 xlx099.iz7auh.net +XRF100 45.62.233.223 XRF100 xlx100.xlxreflector.org +XRF101 45.62.213.101 XRF101 xlx101.xlxreflector.org +XRF102 23.111.174.196 XRF102 xlx102.xlxreflector.org +XRF103 64.137.224.126 XRF103 xlx103.xlxreflector.org +XRF104 23.111.174.197 XRF104 xlx104.xlxreflector.org +XRF105 51.254.99.78 +XRF105 xrf105.xlxreflector.org +XRF109 182.168.128.138 +XRF109 xrf109.tokyo +XRF110 150.7.164.10 +XRF110 xrf110.xreflector-jp.org +XRF111 61.195.96.160 +XRF111 xrf111.xreflector-jp.org +XRF112 94.177.235.81 XRF112 112.xreflector.es +XRF113 212.227.202.198 XRF113 xlx113.homepc.it -XRF113 xrf113.dstarspain.es +XRF114 5.135.188.16 +XRF115 217.182.128.3 +XRF115 reflector-xlx.hb9vd.ch +XRF116 31.185.101.211 +XRF118 5.249.148.252 XRF118 xlx118.ns0.it -XRF120 24.43.83.140 -XRF123 213.126.90.100 -XRF125 xlx125.dyndns.hu -XRF132 xrf132.dstar.radom.pl +XRF119 125.129.207.86 +XRF119 xlx119.dvham.com +XRF120 81.150.10.63 +XRF121 174.37.249.156 +XRF122 83.137.45.126 +XRF122 xrf.vpn4ham.com +XRF123 213.126.90.100 +XRF124 211.14.169.234 +XRF124 xrf124.xreflector-jp.org +XRF125 213.181.208.52 +XRF125 xlx125.dyndns.hu +XRF127 190.112.228.107 +XRF127 pj2man.hopto.org +XRF128 153.147.157.213 +XRF129 220.209.106.220 +XRF129 guwgw.cir-ins.com +XRF130 194.59.177.45 +XRF131 80.127.118.226 +XRF131 xlx131.pe1er.nl +XRF132 91.203.55.87 +XRF132 xrf132.dstar.radom.pl XRF133 xrf133.gb7de.co.uk -XRF145 178.59.21.32 +XRF134 159.89.176.86 +XRF135 74.208.214.69 +XRF140 95.211.211.145 +XRF145 178.59.23.138 +XRF146 213.7.90.5 +XRF146 xlx146.ddns.net XRF147 46.41.1.127 -XRF150 xrf150.dstarspain.es +XRF150 80.211.10.212 +XRF150 argentina.mmdvm.es +XRF153 210.189.104.236 +XRF155 18.235.96.93 +XRF158 150.66.16.176 +XRF160 61.195.109.179 +XRF164 122.222.1.50 +XRF168 xrf168.duckdns.org +XRF170 210.178.113.173 XRF170 dvham.mooo.com +XRF171 210.178.113.123 +XRF171 xrf171.dvham.com +XRF175 162.248.92.25 XRF177 xlx177.webandcloud.net -XRF200 xrf200.theapplecore.co.uk +XRF180 192.241.240.7 +XRF180 xlx180.warn.org +XRF181 122.19.214.143 +XRF185 89.106.108.151 +XRF190 190.194.12.53 +XRF199 153.126.179.214 +XRF200 185.203.119.158 +XRF200 xrf200.theapplecore.me +XRF202 148.251.122.251 +XRF204 85.214.126.111 XRF204 xlx204.ph0dv.nl +XRF206 193.190.240.227 +XRF208 151.80.155.39 +XRF208 xlx208.f5kav.org +XRF210 64.137.224.107 XRF210 210.xreflector.org +XRF212 52.38.90.188 XRF212 xlx212.dstar.club +XRF214 185.47.129.230 XRF214 xlx214.sustrai.org +XRF215 185.87.96.172 XRF216 74.214.25.135 -XRF223 k0pra.ddns.net +XRF220 124.41.83.11 +XRF220 xlx220.sapotech.com +XRF222 212.43.96.84 +XRF222 xlx222.webandcloud.net +XRF223 208.73.201.157 +XRF223 xrf223.parkerradio.org +XRF224 203.137.99.97 +XRF224 xrf224.xreflector-jp.org +XRF226 2.226.183.226 +XRF226 xrf226.hamnet.ro +XRF227 89.33.44.100 +XRF228 212.237.33.114 +XRF229 194.191.4.54 +XRF229 dstar.hamnet.xyz +XRF230 80.250.3.114 +XRF230 ref.dstar.cz +XRF232 89.185.97.35 XRF232 xrf232.tms-it.net -XRF248 xrf248.dyndns.org +XRF233 xlx233.f1smf.com +XRF235 5.150.254.97 +XRF235 xlx235.duckdns.org +XRF238 172.104.239.219 +XRF238 xlx.brandmeister.digital +XRF241 151.80.158.227 +XRF242 73.14.84.43 +XRF242 xrf242.k7edw.com +XRF246 172.93.48.159 +XRF246 xlx.mkagawa.com +XRF248 xrf248.dyndns.org XRF250 xrf250.dstar.su -XRF255 xrf255.reflector.up4dar.de +XRF252 je7zbu.jpn.ph +XRF255 142.91.158.199 +XRF257 47.157.82.87 +XRF258 75.60.237.19 XRF260 xrf260.radiocult.su -XRF262 xrf262.reflector.up4dar.de +XRF261 44.144.0.23 +XRF262 92.201.84.2 +XRF263 85.214.193.146 XRF264 52.2.131.118 +XRF265 51.255.43.60 +XRF266 212.237.51.82 +XRF268 194.38.140.204 +XRF270 158.64.26.132 XRF270 xrf270.reflector.up4dar.de +XRF272 200.231.36.188 XRF275 xrf275.dyndns.org +XRF277 xlx277.dyndns.org +XRF280 95.234.119.44 +XRF282 210.188.25.17 +XRF282 xrf282.dip.jp +XRF284 95.158.165.32 +XRF285 91.92.93.15 +XRF287 43.245.172.2 +XRF288 99.108.210.100 +XRF290 44.182.7.20 +XRF291 101.143.242.189 +XRF291 xrf291.xreflector-jp.org +XRF295 45.62.224.93 XRF295 xrf295.dyndns.org +XRF298 220.144.59.222 +XRF298 xrf298.dip.jp +XRF299 203.86.194.92 +XRF299 xlx299.zl2ro.nz +XRF300 45.62.244.43 XRF300 300.xreflector.org +XRF302 144.217.241.23 +XRF302 xlx302.hopto.org +XRF303 75.70.52.143 +XRF305 145.239.116.57 +XRF307 72.21.76.154 XRF307 xlx307.ddns.net -XRF308 xlx308.w6kd.com +XRF310 52.11.207.121 XRF310 xrf310.xrefl.net -XRF311 xrf311.ernix.de +XRF311 46.41.0.214 +XRF311 xrf311.ernix.de +XRF312 192.241.160.183 XRF312 xrf312.xrefl.net -XRF313 xlx313.xrefl.net -XRF314 xlx314.xrefl.net -XRF317 xrf317.crossroadsdmr.org +XRF313 34.213.108.164 +XRF313 xlx313.openstd.net +XRF314 162.248.10.154 +XRF315 65.101.7.50 +XRF317 44.48.8.15 +XRF317 xrf317.crossroadsdmr.org +XRF318 xrf318.xrefl.net +XRF321 31.207.110.45 XRF321 vps.makeitrad.com +XRF328 212.237.33.114 +XRF328 cisarbasel.ddns.net +XRF329 114.181.139.32 +XRF330 18.222.199.205 +XRF332 188.213.168.99 +XRF333 194.116.29.73 XRF333 xrf333.f1smf.com +XRF334 96.47.95.121 +XRF335 185.206.145.2 +XRF336 23.226.233.133 XRF336 xrf336.mawcg.org -XRF350 350.dstarspain.es +XRF338 122.116.216.47 +XRF339 198.98.53.247 +XRF339 xlx339.avarc.ca +XRF345 45.62.237.34 +XRF345 xrf345.dyndns.org +XRF350 350.opendstar.eu +XRF352 35.230.162.146 XRF353 94.173.206.53 +XRF356 93.152.167.4 +XRF357 93.152.167.4 XRF357 xlx357.w6kd.com -XRF370 xrf370.selfip.com -XRF387 195.130.59.77 +XRF358 93.152.167.4 +XRF359 94.156.172.213 +XRF360 222.229.25.105 +XRF360 xrf360.dip.jp +XRF364 159.65.231.53 +XRF365 59.139.141.204 +XRF365 xrf365.dip.jp +XRF367 18.216.66.72 +XRF367 xrf367.ad6dm.net +XRF370 188.213.168.24 +XRF370 xrf370.selfip.com +XRF371 212.237.8.77 +XRF371 xlx371.selfip.com +XRF373 119.229.134.1 +XRF373 xrf73.dip.jp +XRF374 61.195.108.146 +XRF374 xrf374.xreflector-jp.org +XRF376 75.145.119.225 +XRF377 186.159.96.100 +XRF379 104.218.36.162 +XRF380 160.16.65.39 +XRF380 kdk.ddns.net +XRF382 211.131.19.200 +XRF382 xrf382.pgw.jp +XRF387 195.130.59.77 +XRF388 138.197.67.52 +XRF389 106.70.187.224 +XRF389 xlxdmr.duckdns.org +XRF390 149.7.214.253 XRF390 xrf390.aotnet.it +XRF393 139.91.200.186 +XRF395 5.249.151.111 XRF398 104.167.117.71 -XRF400 xrf400.no-ip.org +XRF399 185.227.110.247 +XRF400 13.58.192.185 +XRF400 xlx400.iz7auh.net +XRF404 91.229.143.187 XRF404 xlx.bendiksverden.net -XRF413 xlx413.xrefl.net +XRF410 xlx.n5amd.com +XRF411 82.171.119.45 +XRF412 61.195.107.113 +XRF412 xrf412.dip.jp +XRF420 174.138.113.116 XRF420 kc9qen.com +XRF421 118.189.181.236 XRF423 4ix.hacktic.de +XRF431 61.195.98.225 +XRF431 xrf431.xreflector-jp.org +XRF433 217.160.22.17 XRF433 xrf433.de -XRF440 dg8rp.dynaccess.de +XRF434 51.254.128.134 +XRF438 80.211.189.236 +XRF440 153.133.72.142 +XRF440 xrf440.e-kyushu.net +XRF441 203.137.99.110 +XRF441 xrf441.xreflector-jp.org XRF443 xrf443.arisondrio.it -XRF444 xlx444.pa3dfn.nl -XRF450 450.xreflector.org -XRF456 xrf456.de +XRF444 188.68.37.51 +XRF444 xlx444.pa3dfn.nl +XRF446 78.226.112.146 +XRF449 159.89.183.117 +XRF450 64.137.224.233 +XRF450 450.xreflector.org +XRF454 218.250.250.21 +XRF455 208.71.169.83 +XRF456 54.37.204.187 +XRF456 xrf456.de +XRF460 183.53.66.145 +XRF464 52.192.129.174 +XRF470 104.49.29.243 +XRF473 104.49.29.243 +XRF477 139.162.213.89 +XRF479 198.58.106.10 +XRF486 51.255.172.249 +XRF486 xlx486.iz8gur.it +XRF487 93.66.214.109 XRF490 xrf490.dyndns.org +XRF499 203.137.76.22 +XRF499 xrf499.xreflector-jp.org XRF500 125.63.57.138 +XRF500 xrf500.org +XRF501 104.130.72.187 XRF502 74.208.88.137 -XRF518 xrf518.n18.de +XRF505 110.141.219.161 +XRF506 121.200.19.211 +XRF508 185.188.4.15 +XRF510 xrf510.s56g.net +XRF511 213.172.232.13 +XRF511 xlx511.ddns.net +XRF515 203.137.78.35 +XRF515 shounandstar.dip.jp +XRF518 176.9.1.168 +XRF518 xrf518.n18.de XRF519 24.55.196.105 +XRF519 xrf519.ve3zin.com +XRF520 xlx.dtdxa.com +XRF521 150.129.184.54 +XRF522 14.102.146.160 +XRF523 175.142.199.32 +XRF525 80.211.68.38 +XRF530 116.251.193.99 +XRF534 208.71.169.83 +XRF538 124.41.76.58 +XRF538 xrf538.dip.jp +XRF544 202.218.152.66 +XRF544 xlx544.ddns.net +XRF550 89.36.222.146 XRF550 550.xreflector.es -XRF555 xrf555.w6kd.com -XRF556 xrf556.w6kd.com +XRF551 140.227.198.45 +XRF553 45.79.92.86 +XRF554 52.35.183.178 +XRF555 xlx555.dtdxa.com +XRF556 xrf556.w6kd.com +XRF559 98.239.113.175 +XRF567 212.91.156.69 +XRF569 203.137.111.98 XRF569 xlxreflector.jpn.ph -XRF570 xrf.no-ip.org +XRF570 104.128.230.153 XRF573 216.189.148.204 -XRF580 67.20.31.79 -XRF600 xrf600.gb7de.co.uk +XRF580 67.20.31.79 +XRF583 116.70.240.104 +XRF587 68.32.126.21 +XRF595 220.146.23.42 +XRF595 hamradio.dip.jp +XRF599 203.137.118.190 +XRF599 xrf599.n5wls.net +XRF600 13.69.14.204 +XRF600 xrf600.gb7de.co.uk +XRF601 51.141.52.193 +XRF602 212.56.100.200 +XRF603 216.246.155.99 XRF603 xlx603.cnharc.org -XRF610 xrf610.vkradio.com -XRF666 vpngrf.webandcloud.net -XRF669 xrf669.no-ip.org +XRF604 139.162.241.24 +XRF605 183.76.179.238 +XRF608 219.122.253.83 +XRF608 xrf608.dip.jp +XRF609 219.122.253.83 +XRF610 89.186.80.81 +XRF610 xrf610.vkradio.com +XRF613 198.50.202.39 +XRF619 167.99.168.82 +XRF626 45.77.234.162 +XRF626 626.nz +XRF627 121.75.75.200 +XRF630 61.195.125.81 +XRF634 180.46.54.237 +XRF634 xrf634.dip.jp +XRF647 217.182.168.54 +XRF651 66.240.165.26 +XRF655 146.64.235.19 +XRF666 86.186.35.158 +XRF666 vpngrf.webandcloud.net +XRF673 180.147.243.178 +XRF673 xrf673.xreflector-jp.org XRF678 xrf678.ddns.net +XRF684 212.237.17.83 +XRF689 97.107.128.47 +XRF695 155.254.33.145 +XRF698 203.137.123.89 +XRF699 82.102.5.239 XRF699 xlx.tekniksnack.se +XRF700 78.47.222.93 XRF700 xrf700.d-star.se -XRF706 xlx706.iz0rin.it +XRF701 61.195.107.77 +XRF701 xrf701.xreflector-jp.org +XRF703 61.195.98.254 +XRF704 150.66.34.110 +XRF706 93.186.255.126 +XRF706 xlx706.iz0rin.it +XRF707 90.145.156.196 XRF707 xrf707.openquad.net -XRF710 oe7mfi.ddns.net +XRF708 202.218.37.62 +XRF708 xrf708.xreflector-jp.org +XRF709 212.237.34.32 +XRF709 xlx.dvmega.co.uk +XRF710 oe7mfi.ddns.net +XRF711 212.237.18.27 +XRF712 153.215.181.34 +XRF712 xrf712.ddo.jp +XRF713 218.251.63.99 XRF714 85.214.119.76 +XRF714 xrf714.ea3hkb.com +XRF715 xlx715.ea3hkb.net +XRF716 xlx716.duckdns.org +XRF717 44.137.70.100 XRF719 199.227.117.121 +XRF720 23.237.16.149 XRF720 xrf720.freestar.us -XRF724 191.232.36.180 +XRF722 80.211.2.161 +XRF722 722.xreflector.es +XRF723 45.33.118.112 +XRF724 189.20.209.70 +XRF724 xlx.dvbrazil.com.br +XRF725 172.245.9.180 +XRF727 108.33.72.83 XRF727 w4icy.inerrantenergy.com +XRF730 186.64.123.59 +XRF732 190.159.68.105 +XRF732 xlx.hk4km.co +XRF733 45.56.117.158 +XRF733 xlx733.ddns.net +XRF735 104.131.81.32 XRF737 195.130.75.246 +XRF738 210.171.151.238 +XRF740 104.167.114.230 XRF740 imagewell.duckdns.org +XRF741 203.137.78.41 +XRF746 178.254.34.44 +XRF747 87.147.142.9 XRF747 xrf747.de +XRF748 64.137.197.36 XRF748 xrf748.dyndns.org -XRF750 104.128.230.153 +XRF749 45.77.102.203 +XRF750 203.86.206.49 +XRF751 203.118.145.79 +XRF752 66.154.105.195 +XRF752 xlx752.zl2wl.nz +XRF755 178.22.148.229 +XRF755 xlx.radioamateur.tk +XRF757 43.229.63.42 XRF757 xrf757.openquad.net +XRF762 129.21.36.65 +XRF766 201.62.48.61 XRF766 xlx.amrase.org.br XRF767 xrf767.de +XRF768 80.211.199.231 +XRF770 153.126.173.9 +XRF773 94.177.175.230 XRF773 xrf773.iz0rin.it +XRF775 149.202.61.17 +XRF776 218.221.181.241 +XRF776 xlx776.tokyo XRF777 112.218.40.91 +XRF780 96.53.97.22 +XRF781 101.143.242.199 +XRF781 xrf781.xreflector-jp.org +XRF782 122.16.56.210 +XRF787 46.41.1.96 XRF787 xrf787.de +XRF788 192.168.0.96 +XRF789 45.33.119.142 XRF789 xrf789.dstarxlx.com.br +XRF794 101.143.242.95 +XRF794 xrf794.xreflector-jp.org +XRF800 87.252.188.119 +XRF801 213.47.71.17 +XRF801 f4hin.fr +XRF803 77.117.21.251 +XRF806 92.107.25.23 +XRF807 122.18.165.164 XRF807 hajikko.iobb.net -XRF810 810.xreflector.org -XRF813 kj4qal.inerrantenergy.com +XRF808 18.220.252.27 +XRF808 xrf808.n5wls.net +XRF809 78.46.11.69 +XRF810 64.137.238.189 +XRF810 810.xreflector.org +XRF811 64.137.238.189 +XRF812 203.145.233.141 +XRF812 xrf812.xreflector-jp.org +XRF813 97.76.81.165 +XRF813 xlx.inerrantenergy.com +XRF817 18.235.96.93 +XRF818 120.79.155.116 +XRF825 51.75.252.197 +XRF828 195.225.116.244 XRF828 xlx828.ddnss.de +XRF833 78.226.112.146 +XRF844 137.226.79.122 +XRF847 162.243.4.29 +XRF850 88.198.94.77 XRF850 xrf850.xrfmaster.net -XRF851 xrf851.rsdt.de +XRF851 xrf851.rsdt.de +XRF852 42.2.140.44 +XRF858 xrf858.ke0lmx.net +XRF859 54.227.203.214 +XRF859 xlx859.ke0lmx.net +XRF860 24.134.86.93 XRF860 xrf.njpaasterisk.org -XRF870 103.18.207.114 +XRF861 66.175.218.63 +XRF865 45.32.212.226 +XRF866 93.233.176.219 +XRF867 51.254.115.5 +XRF870 103.3.234.95 +XRF870 xrf870.ddns.net +XRF871 222.172.252.56 +XRF878 203.137.123.113 +XRF878 xrf878.xreflector-jp.org +XRF880 176.10.105.211 +XRF883 153.179.226.85 +XRF883 xrf883.dip.jp +XRF886 118.163.103.178 XRF886 xrf886.metropit.net +XRF887 118.163.103.177 +XRF888 46.18.142.169 XRF888 xlx888.ns0.it +XRF889 130.149.36.93 +XRF893 104.223.59.212 XRF897 92.222.23.124 +XRF900 94.177.237.192 XRF901 xrf901.dyndns.org XRF902 xrf902.dyndns.org -XRF905 199.212.121.20 +XRF903 80.211.29.226 +XRF904 211.14.169.215 +XRF905 199.212.121.20 +XRF906 212.237.11.53 XRF906 xrf906.radioclubveleta.es -XRF909 xrf909.ealink.org -XRF911 5.196.73.89 +XRF907 88.3.75.162 +XRF907 xlx907.ddns.net +XRF908 92.222.23.124 +XRF909 216.86.147.198 +XRF909 www.ealink.es +XRF910 92.177.212.64 +XRF911 xlx911.patrweb.com +XRF912 80.211.1.143 +XRF915 72.28.30.93 +XRF919 80.211.232.174 XRF920 xrf920.oe7xxr.ampr.at +XRF921 44.143.184.83 +XRF921 xlx921.oe7xxr.ampr.at +XRF922 81.150.10.62 +XRF922 xrf922.mb6er.com +XRF925 90.255.232.101 +XRF929 158.69.166.132 XRF929 xrf929.ddns.net +XRF930 94.177.160.5 XRF930 xreflector.ddns.net +XRF931 68.131.30.206 +XRF931 xref.kw4yb.com +XRF933 164.132.104.167 +XRF935 188.213.166.199 +XRF935 xlx935.ddns.net +XRF940 202.218.37.121 +XRF940 xrf940.xreflector-jp.org +XRF944 202.218.34.210 +XRF944 xrf944.xreflector-jp.org +XRF945 213.202.229.40 +XRF945 xlx945.xreflector.es +XRF946 212.227.174.45 +XRF950 158.64.26.134 XRF950 xlx950.epf.lu +XRF951 18.188.166.109 +XRF956 192.99.245.120 +XRF959 203.137.98.121 +XRF960 80.211.226.89 +XRF964 52.173.142.244 +XRF965 47.23.66.19 +XRF966 203.150.19.24 +XRF967 95.158.165.32 +XRF967 xlx967.uk.to +XRF969 142.93.46.36 +XRF970 157.7.221.186 +XRF972 46.121.158.50 +XRF973 211.14.169.43 +XRF973 xrf973.xreflector-jp.org +XRF974 94.177.217.52 +XRF974 xlx974.dynu.net +XRF975 176.31.161.9 +XRF976 212.237.36.71 +XRF977 977.opendstar.eu +XRF978 74.104.179.159 +XRF978 978.opendstar.eu +XRF979 217.162.36.91 +XRF981 153.210.14.45 XRF986 81.89.102.160 +XRF987 185.32.183.148 XRF987 xrf987.metro-uhf.org -XRF988 988.xreflector.es +XRF988 80.211.236.189 +XRF988 988.xreflector.es +XRF989 50.27.131.75 XRF989 xrf989.bbhill.net +XRF990 35.164.237.63 +XRF991 91.92.136.118 +XRF993 97.64.20.63 +XRF994 35.177.233.106 +XRF995 118.27.30.92 +XRF995 xlx995.ddns.net +XRF996 47.104.177.248 +XRF997 94.177.187.40 +XRF997 xrf997.iw2gob.it +XRF998 44.140.236.20 XRF998 xlx.sm7.hamnet.nu +XRF999 94.177.173.53 XRF999 xrf999.no-ip.org +XRFWDX 47.149.178.211 +XRFWDX worldwidedx.com +# EOF - Sun, 19 May 2019 12:35:55 GMT diff --git a/Data/DPlus_Hosts.txt b/Data/DPlus_Hosts.txt index 5e6bf6c..2cedcd3 100644 --- a/Data/DPlus_Hosts.txt +++ b/Data/DPlus_Hosts.txt @@ -1,110 +1,96 @@ -#>>Downloaded from W6KD host file server -#>>Last updated 17 NOV 2016 by W6KD -#>>Request changes on this server's lists by posting at -#>>http://xrefl.boards.net/board/2/directory-changes-forum -REF001 ref001.dstargateway.org -REF002 ref002.dstargateway.org -REF003 ref003.dstargateway.org -REF004 ref004.dstargateway.org -REF005 ref005.dstargateway.org -REF006 ref006.dstargateway.org -REF007 ref007.dstargateway.org -REF008 ref008.dstargateway.org -REF009 ref009.dstargateway.org -REF010 ref010.dstargateway.org -REF011 ref011.dstargateway.org -REF012 ref012.dstargateway.org -REF013 ref013.dstargateway.org -REF014 ref014.dstargateway.org -REF015 ref015.dstargateway.org -REF016 ref016.dstargateway.org -REF017 ref017.dstargateway.org -REF018 ref018.dstargateway.org -REF019 ref019.dstargateway.org -REF020 ref020.dstargateway.org -REF021 ref021.dstargateway.org -REF022 ref022.dstargateway.org -REF023 ref023.dstargateway.org -REF024 ref024.dstargateway.org -REF025 ref025.dstargateway.org -REF026 ref026.dstargateway.org -REF027 ref027.dstargateway.org -REF028 ref028.dstargateway.org -REF029 ref029.dstargateway.org -REF030 ref030.dstargateway.org -REF031 ref031.dstargateway.org -REF032 ref032.dstargateway.org -REF033 ref033.dstargateway.org -REF034 ref034.dstargateway.org -REF035 ref035.dstargateway.org -REF036 ref036.dstargateway.org -REF037 ref037.dstargateway.org -REF038 ref038.dstargateway.org -REF039 ref039.dstargateway.org -REF040 ref040.dstargateway.org -REF041 ref041.dstargateway.org -REF042 ref042.dstargateway.org -REF043 ref043.dstargateway.org -REF044 ref044.dstargateway.org -REF045 ref045.dstargateway.org -REF046 ref046.dstargateway.org -REF047 ref047.dstargateway.org -REF048 ref048.dstargateway.org -REF049 ref049.dstargateway.org -REF050 ref050.dstargateway.org -REF051 ref051.dstargateway.org -REF052 ref052.dstargateway.org -REF053 ref053.dstargateway.org -REF054 ref054.dstargateway.org -REF055 ref055.dstargateway.org -REF056 ref056.dstargateway.org -REF057 ref057.dstargateway.org -REF058 ref058.dstargateway.org -REF059 ref059.dstargateway.org -REF060 ref060.dstargateway.org -REF061 ref061.dstargateway.org -REF062 ref062.dstargateway.org -REF063 ref063.dstargateway.org -REF064 ref064.dstargateway.org -REF065 ref065.dstargateway.org -REF066 ref066.dstargateway.org -REF067 ref067.dstargateway.org -REF068 ref068.dstargateway.org -REF069 ref069.dstargateway.org -REF070 ref070.dstargateway.org -REF071 ref071.dstargateway.org -REF072 ref072.dstargateway.org -#REF073 ref073.dstargateway.org -#REF074 ref074.dstargateway.org -REF075 ref075.dstargateway.org -REF076 ref076.dstargateway.org -REF077 ref077.dstargateway.org -REF078 ref078.dstargateway.org -#REF079 ref079.dstargateway.org -#REF080 ref080.dstargateway.org -#REF081 ref081.dstargateway.org -#REF082 ref082.dstargateway.org -#REF083 ref083.dstargateway.org -#REF084 ref084.dstargateway.org -#REF085 ref085.dstargateway.org -#REF086 ref086.dstargateway.org -#REF087 ref087.dstargateway.org -#REF088 ref088.dstargateway.org -#REF089 ref089.dstargateway.org -#REF090 ref090.dstargateway.org -#REF091 ref091.dstargateway.org -#REF092 ref092.dstargateway.org -#REF093 ref093.dstargateway.org -#REF094 ref094.dstargateway.org -#REF095 ref095.dstargateway.org -#REF096 ref096.dstargateway.org -#REF097 ref097.dstargateway.org -#REF098 ref098.dstargateway.org -#REF099 ref099.dstargateway.org -REF117 ref001.dstargateway.org -REF212 xlx212.dstar.club -REF308 xlx308.w6kd.com -REF313 xlx313.xrefl.net -REF357 xlx357.w6kd.com -REF404 xlx.bendiksverden.net -REF850 xrf850.xrfmaster.net +# Prepared at ar-dns.net - Sun, 19 May 2019 12:38:29 GMT +REF001 ref001.dstargateway.org +REF002 ref002.dstargateway.org +REF003 ref003.dstargateway.org +REF004 ref004.dstargateway.org +REF005 ref005.dstargateway.org +REF006 ref006.dstargateway.org +REF007 ref007.dstargateway.org +REF008 ref008.dstargateway.org +REF009 ref009.dstargateway.org +REF010 ref010.dstargateway.org +REF011 ref011.dstargateway.org +REF012 ref012.dstargateway.org +REF013 ref013.dstargateway.org +REF014 ref014.dstargateway.org +REF015 ref015.dstargateway.org +REF016 ref016.dstargateway.org +REF017 ref017.dstargateway.org +REF018 ref018.dstargateway.org +REF019 ref019.dstargateway.org +REF020 ref020.dstargateway.org +REF021 ref021.dstargateway.org +REF022 ref022.dstargateway.org +REF023 ref023.dstargateway.org +REF024 ref024.dstargateway.org +REF025 ref025.dstargateway.org +REF026 ref026.dstargateway.org +REF027 ref027.dstargateway.org +REF028 ref028.dstargateway.org +REF029 ref029.dstargateway.org +REF030 ref030.dstargateway.org +REF031 ref031.dstargateway.org +REF032 ref032.dstargateway.org +REF033 ref033.dstargateway.org +REF034 ref034.dstargateway.org +REF035 ref035.dstargateway.org +REF036 ref036.dstargateway.org +REF037 ref037.dstargateway.org +REF038 ref038.dstargateway.org +REF039 ref039.dstargateway.org +REF040 ref040.dstargateway.org +REF041 ref041.dstargateway.org +REF042 ref042.dstargateway.org +REF043 ref043.dstargateway.org +REF044 ref044.dstargateway.org +REF045 ref045.dstargateway.org +REF046 ref046.dstargateway.org +REF047 ref047.dstargateway.org +REF048 ref048.dstargateway.org +REF049 ref049.dstargateway.org +REF050 ref050.dstargateway.org +REF051 ref051.dstargateway.org +REF052 ref052.dstargateway.org +REF053 ref053.dstargateway.org +REF054 ref054.dstargateway.org +REF055 ref055.dstargateway.org +REF056 ref056.dstargateway.org +REF057 ref057.dstargateway.org +REF058 ref058.dstargateway.org +REF059 ref059.dstargateway.org +REF060 ref060.dstargateway.org +REF061 ref061.dstargateway.org +REF062 ref062.dstargateway.org +REF063 ref063.dstargateway.org +REF064 ref064.dstargateway.org +REF065 ref065.dstargateway.org +REF066 ref066.dstargateway.org +REF067 ref067.dstargateway.org +REF068 ref068.dstargateway.org +REF069 ref069.dstargateway.org +REF070 ref070.dstargateway.org +REF071 ref071.dstargateway.org +REF072 ref072.dstargateway.org +REF073 ref073.dstargateway.org +REF074 ref074.dstargateway.org +REF075 ref075.dstargateway.org +REF076 ref076.dstargateway.org +REF077 ref077.dstargateway.org +REF078 ref078.dstargateway.org +REF079 ref079.dstargateway.org +REF080 ref080.dstargateway.org +REF081 ref081.dstargateway.org +REF082 ref082.dstargateway.org +REF083 ref083.dstargateway.org +REF084 ref084.dstargateway.org +REF085 ref085.dstargateway.org +REF086 ref086.dstargateway.org +REF087 ref087.dstargateway.org +REF088 ref088.dstargateway.org +REF089 ref089.dstargateway.org +REF367 xrf367.ad6dm.net +REF425 xlx425.xlx.ar-dns.net +REF520 xlx.dtdxa.com +REF555 xlx555.dtdxa.com +REF911 xlx911.patrweb.com +# EOF - Sun, 19 May 2019 12:38:29 GMT diff --git a/Data/Makefile b/Data/Makefile index 4350c30..7af396d 100644 --- a/Data/Makefile +++ b/Data/Makefile @@ -1,36 +1,37 @@ +.PHONY: install install: - install -d -g bin -o root -m 0775 $(DATADIR) - install -g bin -o root -m 0664 CCS_Hosts.txt $(DATADIR) - install -g bin -o root -m 0664 DCS_Hosts.txt $(DATADIR) - install -g bin -o root -m 0664 DExtra_Hosts.txt $(DATADIR) - install -g bin -o root -m 0664 DPlus_Hosts.txt $(DATADIR) - install -g bin -o root -m 0664 TIME_de_DE.ambe $(DATADIR) - install -g bin -o root -m 0664 TIME_de_DE.indx $(DATADIR) - install -g bin -o root -m 0664 TIME_en_GB.ambe $(DATADIR) - install -g bin -o root -m 0664 TIME_en_GB.indx $(DATADIR) - install -g bin -o root -m 0664 TIME_en_US.ambe $(DATADIR) - install -g bin -o root -m 0664 TIME_en_US.indx $(DATADIR) - install -g bin -o root -m 0664 TIME_fr_FR.ambe $(DATADIR) - install -g bin -o root -m 0664 TIME_fr_FR.indx $(DATADIR) - install -g bin -o root -m 0664 TIME_se_SE.ambe $(DATADIR) - install -g bin -o root -m 0664 TIME_se_SE.indx $(DATADIR) - install -g bin -o root -m 0664 de_DE.ambe $(DATADIR) - install -g bin -o root -m 0664 de_DE.indx $(DATADIR) - install -g bin -o root -m 0664 dk_DK.ambe $(DATADIR) - install -g bin -o root -m 0664 dk_DK.indx $(DATADIR) - install -g bin -o root -m 0664 en_GB.ambe $(DATADIR) - install -g bin -o root -m 0664 en_GB.indx $(DATADIR) - install -g bin -o root -m 0664 en_US.ambe $(DATADIR) - install -g bin -o root -m 0664 en_US.indx $(DATADIR) - install -g bin -o root -m 0664 es_ES.ambe $(DATADIR) - install -g bin -o root -m 0664 es_ES.indx $(DATADIR) - install -g bin -o root -m 0664 fr_FR.ambe $(DATADIR) - install -g bin -o root -m 0664 fr_FR.indx $(DATADIR) - install -g bin -o root -m 0664 it_IT.ambe $(DATADIR) - install -g bin -o root -m 0664 it_IT.indx $(DATADIR) - install -g bin -o root -m 0664 no_NO.ambe $(DATADIR) - install -g bin -o root -m 0664 no_NO.indx $(DATADIR) - install -g bin -o root -m 0664 pl_PL.ambe $(DATADIR) - install -g bin -o root -m 0664 pl_PL.indx $(DATADIR) - install -g bin -o root -m 0664 se_SE.ambe $(DATADIR) - install -g bin -o root -m 0664 se_SE.indx $(DATADIR) + install -d -g root -o root -m 0755 $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 CCS_Hosts.txt $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 DCS_Hosts.txt $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 DExtra_Hosts.txt $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 DPlus_Hosts.txt $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 TIME_de_DE.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 TIME_de_DE.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 TIME_en_GB.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 TIME_en_GB.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 TIME_en_US.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 TIME_en_US.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 TIME_fr_FR.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 TIME_fr_FR.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 TIME_se_SE.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 TIME_se_SE.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 de_DE.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 de_DE.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 dk_DK.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 dk_DK.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 en_GB.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 en_GB.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 en_US.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 en_US.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 es_ES.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 es_ES.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 fr_FR.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 fr_FR.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 it_IT.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 it_IT.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 no_NO.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 no_NO.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 pl_PL.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 pl_PL.indx $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 se_SE.ambe $(DESTDIR)$(DATADIR) + install -g root -o root -m 0644 se_SE.indx $(DESTDIR)$(DATADIR) diff --git a/GUICommon/DCSSet.cpp b/GUICommon/DCSSet.cpp index 6339de8..9bc22b2 100644 --- a/GUICommon/DCSSet.cpp +++ b/GUICommon/DCSSet.cpp @@ -109,12 +109,13 @@ bool CDCSSet::Validate() if (n == wxNOT_FOUND) return false; - n = m_ccsEnabled->GetCurrentSelection(); - if (n == wxNOT_FOUND) - return false; + bool ccsEnabled = m_ccsEnabled->GetCurrentSelection() == 1; + bool ccsHostSelected = m_ccsHosts->GetCurrentSelection() != wxNOT_FOUND; - if (m_ccsHosts->GetCurrentSelection() == wxNOT_FOUND) + if (ccsEnabled && !ccsHostSelected) { + wxMessageBox(_("CCS is enabled and no CCS host has been selected. Either disable CCS or select a CCS host.")); return false; + } return true; } diff --git a/GUICommon/DPRSSet.cpp b/GUICommon/DPRSSet.cpp index 5a99dde..be2a8b4 100644 --- a/GUICommon/DPRSSet.cpp +++ b/GUICommon/DPRSSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 by Jonathan Naylor G4KLX + * Copyright (C) 2010,2018,2020 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 @@ -25,11 +25,11 @@ const unsigned int CONTROL_WIDTH2 = 80U; const unsigned int PORT_LENGTH = 5U; const unsigned int PASSWORD_LENGTH = 5U; -CDPRSSet::CDPRSSet(wxWindow* parent, int id, const wxString& title, bool enabled, const wxString& hostname, unsigned int port) : +CDPRSSet::CDPRSSet(wxWindow* parent, int id, const wxString& title, bool enabled, const wxString& address, unsigned int port) : wxPanel(parent, id), m_title(title), m_enabled(NULL), -m_hostname(NULL), +m_address(NULL), m_port(NULL) { wxFlexGridSizer* sizer = new wxFlexGridSizer(2); @@ -43,11 +43,11 @@ m_port(NULL) sizer->Add(m_enabled, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_enabled->SetSelection(enabled ? 1 : 0); - wxStaticText* hostnameLabel = new wxStaticText(this, -1, _("Hostname")); - sizer->Add(hostnameLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); + wxStaticText* addressLabel = new wxStaticText(this, -1, _("Address")); + sizer->Add(addressLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - m_hostname = new wxTextCtrl(this, -1, hostname, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); - sizer->Add(m_hostname, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); + m_address = new wxTextCtrl(this, -1, address, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); + sizer->Add(m_address, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); wxStaticText* portLabel = new wxStaticText(this, -1, _("Port")); sizer->Add(portLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); @@ -75,8 +75,8 @@ bool CDPRSSet::Validate() if (n == wxNOT_FOUND) return false; - wxString hostname = m_hostname->GetValue(); - if (hostname.IsEmpty()) + wxString address = m_address->GetValue(); + if (address.IsEmpty()) return true; unsigned int port = getPort(); @@ -99,9 +99,9 @@ bool CDPRSSet::getEnabled() const return c == 1; } -wxString CDPRSSet::getHostname() const +wxString CDPRSSet::getAddress() const { - return m_hostname->GetValue(); + return m_address->GetValue(); } unsigned int CDPRSSet::getPort() const diff --git a/GUICommon/DPRSSet.h b/GUICommon/DPRSSet.h index 2d18220..78185c8 100644 --- a/GUICommon/DPRSSet.h +++ b/GUICommon/DPRSSet.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 by Jonathan Naylor G4KLX + * Copyright (C) 2010,2018,2020 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 @@ -25,19 +25,19 @@ class CDPRSSet : public wxPanel { public: - CDPRSSet(wxWindow* parent, int id, const wxString& title, bool enabled, const wxString& hostname, unsigned int port); + CDPRSSet(wxWindow* parent, int id, const wxString& title, bool enabled, const wxString& address, unsigned int port); virtual ~CDPRSSet(); virtual bool Validate(); virtual bool getEnabled() const; - virtual wxString getHostname() const; + virtual wxString getAddress() const; virtual unsigned int getPort() const; private: wxString m_title; wxChoice* m_enabled; - wxTextCtrl* m_hostname; + wxTextCtrl* m_address; CPortTextCtrl* m_port; }; diff --git a/GUICommon/GPSDSet.cpp b/GUICommon/GPSDSet.cpp new file mode 100644 index 0000000..b95838a --- /dev/null +++ b/GUICommon/GPSDSet.cpp @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2018,2020 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "GPSDSet.h" + +const unsigned int CONTROL_WIDTH1 = 130U; +const unsigned int CONTROL_WIDTH2 = 80U; + +const unsigned int ADDRESS_LENGTH = 15U; +const unsigned int PORT_LENGTH = 5U; + +const unsigned int BORDER_SIZE = 5U; + +CGPSDSet::CGPSDSet(wxWindow* parent, int id, const wxString& title, bool enabled, const wxString& address, const wxString& port) : +wxPanel(parent, id), +m_title(title), +m_enabled(NULL), +m_address(NULL), +m_port(NULL) +{ + wxFlexGridSizer* sizer = new wxFlexGridSizer(2); + + wxStaticText* enabledLabel = new wxStaticText(this, -1, _("Mobile GPS")); + sizer->Add(enabledLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); + + m_enabled = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); + m_enabled->Append(_("Disabled")); + m_enabled->Append(_("Enabled")); + sizer->Add(m_enabled, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); + m_enabled->SetSelection(enabled ? 1 : 0); + + wxStaticText* addressLabel = new wxStaticText(this, -1, _("Address")); + sizer->Add(addressLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); + + m_address = new CAddressTextCtrl(this, -1, address, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1)); + m_address->SetMaxLength(ADDRESS_LENGTH); + sizer->Add(m_address, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); + + wxStaticText* portLabel = new wxStaticText(this, -1, _("Port")); + sizer->Add(portLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); + + m_port = new CPortTextCtrl(this, -1, port, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1)); + m_port->SetMaxLength(PORT_LENGTH); + sizer->Add(m_port, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); + + SetAutoLayout(true); + + SetSizer(sizer); +} + + +CGPSDSet::~CGPSDSet() +{ +} + +bool CGPSDSet::Validate() +{ + if (m_enabled->GetCurrentSelection() == wxNOT_FOUND) + return false; + + wxString address = getAddress(); + + if (address.IsEmpty()) { + wxMessageDialog dialog(this, _("The Mobile GPS Address is not valid"), m_title + _(" Error"), wxICON_ERROR); + dialog.ShowModal(); + return false; + } + + unsigned long port; + getPort().ToULong(&port); + + if (port == 0UL || port > 65535UL) { + wxMessageDialog dialog(this, _("The Mobile GPS Port is not valid"), m_title + _(" Error"), wxICON_ERROR); + dialog.ShowModal(); + return false; + } + + return true; +} + +bool CGPSDSet::getEnabled() const +{ + int c = m_enabled->GetCurrentSelection(); + if (c == wxNOT_FOUND) + return false; + + return c == 1; +} + +wxString CGPSDSet::getAddress() const +{ + return m_address->GetValue(); +} + +wxString CGPSDSet::getPort() const +{ + return m_port->GetValue(); +} + diff --git a/GUICommon/GPSDSet.h b/GUICommon/GPSDSet.h new file mode 100644 index 0000000..85e7e5e --- /dev/null +++ b/GUICommon/GPSDSet.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2018,2020 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef GPSDSet_H +#define GPSDSet_H + +#include "AddressTextCtrl.h" +#include "PortTextCtrl.h" +#include "Defs.h" + +#include + +class CGPSDSet: public wxPanel { +public: + CGPSDSet(wxWindow* parent, int id, const wxString& title, bool enabled, const wxString& address, const wxString& port); + virtual ~CGPSDSet(); + + virtual bool Validate(); + + virtual bool getEnabled() const; + virtual wxString getAddress() const; + virtual wxString getPort() const; + +private: + wxString m_title; + wxChoice* m_enabled; + CAddressTextCtrl* m_address; + CPortTextCtrl* m_port; +}; + +#endif diff --git a/GUICommon/GUICommon.vcxproj b/GUICommon/GUICommon.vcxproj index b04a02c..832cc6d 100644 --- a/GUICommon/GUICommon.vcxproj +++ b/GUICommon/GUICommon.vcxproj @@ -22,29 +22,29 @@ {02D03515-0BBE-4553-8C40-566A597478F8} GUICommon Win32Proj - 10.0.16299.0 + 10.0 StaticLibrary - v141 + v142 Unicode true StaticLibrary - v141 + v142 Unicode true StaticLibrary - v141 + v142 Unicode StaticLibrary - v141 + v142 Unicode @@ -77,6 +77,10 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) + + + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) @@ -139,6 +143,7 @@ + @@ -155,6 +160,7 @@ + @@ -166,4 +172,4 @@ - \ No newline at end of file + diff --git a/GUICommon/GUICommon.vcxproj.filters b/GUICommon/GUICommon.vcxproj.filters index 479d80d..69724e2 100644 --- a/GUICommon/GUICommon.vcxproj.filters +++ b/GUICommon/GUICommon.vcxproj.filters @@ -32,6 +32,9 @@ Source Files + + Source Files + Source Files @@ -76,6 +79,9 @@ Header Files + + Header Files + Header Files @@ -98,4 +104,4 @@ Header Files - \ No newline at end of file + diff --git a/GUICommon/Makefile b/GUICommon/Makefile index 4a837a3..4c3524e 100644 --- a/GUICommon/Makefile +++ b/GUICommon/Makefile @@ -1,14 +1,20 @@ -OBJECTS = AddressTextCtrl.o CallsignTextCtrl.o DCSSet.o DescriptionTextCtrl.o DExtraSet.o DPlusSet.o DPRSSet.o PortTextCtrl.o RemoteSet.o \ +OBJECTS = AddressTextCtrl.o CallsignTextCtrl.o DCSSet.o DescriptionTextCtrl.o DExtraSet.o DPlusSet.o DPRSSet.o GPSDSet.o PortTextCtrl.o RemoteSet.o \ RepeaterDataSet.o RepeaterInfoSet.o RestrictedTextCtrl.o StarNetSet.o XLXSet.o +.PHONY: all all: GUICommon.a -GUICommon.a: $(OBJECTS) +GUICommon.a: $(OBJECTS) ../Common/Common.a $(AR) rcs GUICommon.a $(OBJECTS) +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) $(CFLAGS) -I../Common -c -o $@ $< + $(CXX) -MM $(CFLAGS) -I../Common $< > $*.d +.PHONY: clean clean: $(RM) GUICommon.a *.o *.d *.bak *~ +../Common/Common.a: diff --git a/GUICommon/XLXSet.cpp b/GUICommon/XLXSet.cpp index 616e6c0..7d04f98 100644 --- a/GUICommon/XLXSet.cpp +++ b/GUICommon/XLXSet.cpp @@ -20,6 +20,8 @@ #include "XLXSet.h" #include "Defs.h" +#include + // TODO F4FXL try to figure out why below symbols are not found under ubuntu //#include @@ -34,11 +36,10 @@ BEGIN_EVENT_TABLE(CXLXSet, wxPanel) END_EVENT_TABLE() -CXLXSet::CXLXSet(wxWindow* parent, int id, const wxString& title, bool xlxEnabled, bool xlxOverrideLocal, const wxString& xlxHostsFileUrl) : +CXLXSet::CXLXSet(wxWindow* parent, int id, const wxString& title, bool xlxEnabled, const wxString& xlxHostsFileUrl) : wxPanel(parent, id), m_title(title), m_xlxEnabled(NULL), -m_xlxOverrideLocal(NULL), m_xlxHostsFileUrl(NULL) { wxFlexGridSizer* sizer = new wxFlexGridSizer(2); @@ -51,15 +52,6 @@ m_xlxHostsFileUrl(NULL) m_xlxEnabled->Append(_("Enabled")); sizer->Add(m_xlxEnabled, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); m_xlxEnabled->SetSelection(xlxEnabled ? 1 : 0); - - wxStaticText* xlxOverrideLocalLabel = new wxStaticText(this, -1, _("Override local hosts files")); - sizer->Add(xlxOverrideLocalLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); - - m_xlxOverrideLocal = new wxChoice(this, CHOICE_ENABLED, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1)); - m_xlxOverrideLocal->Append(_("No")); - m_xlxOverrideLocal->Append(_("Yes")); - sizer->Add(m_xlxOverrideLocal, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE); - m_xlxOverrideLocal->SetSelection(xlxOverrideLocal ? 1 : 0); wxStaticText* xlxHostsFileUrlLabel = new wxStaticText(this, -1, _("Hosts file URL")); sizer->Add(xlxHostsFileUrlLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE); @@ -88,28 +80,22 @@ bool CXLXSet::Validate() int n = m_xlxEnabled->GetCurrentSelection(); if (n == wxNOT_FOUND) return false; - - n = m_xlxOverrideLocal->GetCurrentSelection(); - if (n == wxNOT_FOUND) - return false; +#if defined(__WINDOWS__) // TODO F4FXL try to figure out why below symbols are not found under ubuntu - /*wxString value = m_xlxHostsFileUrl->GetValue(); + wxString value = m_xlxHostsFileUrl->GetValue(); wxURL url(value); - if (url.GetError() != wxURL_NOERR) - return false;*/ + if (url.GetError() == wxURL_NOERR) + return true; + wxMessageDialog dialog(this, _("The XLX host file URL is not valid"), m_title + _(" Error"), wxICON_ERROR); + dialog.ShowModal(); + return false; +#else return true; +#endif } -bool CXLXSet::getXLXOverrideLocal() const -{ - int c = m_xlxEnabled->GetCurrentSelection(); - if (c == wxNOT_FOUND) - return false; - - return c == 1; -} bool CXLXSet::getXLXEnabled() const { @@ -124,13 +110,16 @@ wxString CXLXSet::getXLXHostsFileUrl() const { wxString value = m_xlxHostsFileUrl->GetValue(); - +#if defined(__WINDOWS__) // TODO F4FXL try to figure out why below symbols are not found under ubuntu - //wxURL url(value); - //if (url.GetError() == wxURL_NOERR) - // return value; - + wxURL url(value); + if (url.GetError() == wxURL_NOERR) + return value; + return wxEmptyString; +#else + return value; +#endif } void CXLXSet::onEnabled(wxCommandEvent &event) diff --git a/GUICommon/XLXSet.h b/GUICommon/XLXSet.h index f765b55..fee249f 100644 --- a/GUICommon/XLXSet.h +++ b/GUICommon/XLXSet.h @@ -23,13 +23,12 @@ class CXLXSet : public wxPanel { public: - CXLXSet(wxWindow* parent, int id, const wxString& title, bool xlxEnabled, bool xlxOverrideLocal, const wxString& xlxHostsFileUrl); + CXLXSet(wxWindow* parent, int id, const wxString& title, bool xlxEnabled, const wxString& xlxHostsFileUrl); virtual ~CXLXSet(); virtual bool Validate(); virtual bool getXLXEnabled() const; - virtual bool getXLXOverrideLocal() const; virtual wxString getXLXHostsFileUrl() const; virtual void onEnabled(wxCommandEvent& event); @@ -37,7 +36,6 @@ public: private: wxString m_title; wxChoice* m_xlxEnabled; - wxChoice* m_xlxOverrideLocal; wxTextCtrl* m_xlxHostsFileUrl; DECLARE_EVENT_TABLE() diff --git a/Makefile b/Makefile index 55bdb1d..b3d02ec 100644 --- a/Makefile +++ b/Makefile @@ -1,76 +1,111 @@ -export DATADIR := "/usr/share/ircddbgateway" -export LOGDIR := "/var/log" -export CONFDIR := "/etc" -export BINDIR := "/usr/bin" +export BUILD ?= debug +ifeq ($(TARGET), opendv) +export DATADIR ?= /usr/share/opendv +export LOGDIR ?= /var/log/opendv +export CONFDIR ?= /etc +export BINDIR ?= /usr/sbin +else +export DATADIR ?= /usr/share/ircddbgateway +export LOGDIR ?= /var/log +export CONFDIR ?= /etc +export BINDIR ?= /usr/bin +endif +# Add -DDCS_LINK to the end of the CFLAGS line below to add DCS linking to StarNet +# Add -DDEXTRA_LINK to the end of the CFLAGS line below to add DExtra linking to StarNet + +# Add -DUSE_GPS to the end of the CFLAGS line to enable the use of gpsd, and add -lgps to +# end of the LIBS line. + +DEBUGFLAGS := -g -D_DEBUG +RELEASEFLAGS := -DNDEBUG -DwxDEBUG_LEVEL=0 export CXX := $(shell wx-config --cxx) -export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)' -export GUILIBS := $(shell wx-config --libs adv,core,base) -export LIBS := $(shell wx-config --libs base) +export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='"$(LOGDIR)"' -DCONF_DIR='"$(CONFDIR)"' -DDATA_DIR='"$(DATADIR)"' +ifeq ($(BUILD), debug) + export CFLAGS := $(CFLAGS) $(DEBUGFLAGS) +else ifeq ($(BUILD), release) + export CFLAGS := $(CFLAGS) $(RELEASEFLAGS) +endif +export LIBS := $(shell wx-config --libs base,net) export LDFLAGS := -all: ircDDBGateway/ircddbgatewayd ircDDBGatewayConfig/ircddbgatewayconfig APRSTransmit/aprstransmitd RemoteControl/remotecontrold \ +.PHONY: all +all: ircDDBGateway/ircddbgatewayd APRSTransmit/aprstransmitd RemoteControl/remotecontrold \ StarNetServer/starnetserverd TextTransmit/texttransmitd TimerControl/timercontrold TimeServer/timeserverd VoiceTransmit/voicetransmitd -ircDDBGateway/ircddbgatewayd: Common/Common.a ircDDB/IRCDDB.a - make -C ircDDBGateway +ircDDBGateway/ircddbgatewayd: Common/Common.a ircDDB/IRCDDB.a force + $(MAKE) -C ircDDBGateway -ircDDBGatewayConfig/ircddbgatewayconfig: GUICommon/GUICommon.a Common/Common.a - make -C ircDDBGatewayConfig +APRSTransmit/aprstransmitd: Common/Common.a force + $(MAKE) -C APRSTransmit -APRSTransmit/aprstransmitd: Common/Common.a - make -C APRSTransmit +RemoteControl/remotecontrold: Common/Common.a force + $(MAKE) -C RemoteControl -RemoteControl/remotecontrold: Common/Common.a - make -C RemoteControl +StarNetServer/starnetserverd: Common/Common.a ircDDB/IRCDDB.a force + $(MAKE) -C StarNetServer -StarNetServer/starnetserverd: Common/Common.a ircDDB/IRCDDB.a - make -C StarNetServer +TextTransmit/texttransmitd: Common/Common.a force + $(MAKE) -C TextTransmit -TextTransmit/texttransmitd: Common/Common.a - make -C TextTransmit +TimerControl/timercontrold: Common/Common.a force + $(MAKE) -C TimerControl -TimerControl/timercontrold: Common/Common.a GUICommon/GUICommon.a - make -C TimerControl +TimeServer/timeserverd: Common/Common.a force + $(MAKE) -C TimeServer -TimeServer/timeserverd: Common/Common.a GUICommon/GUICommon.a - make -C TimeServer +VoiceTransmit/voicetransmitd: Common/Common.a force + $(MAKE) -C VoiceTransmit -VoiceTransmit/voicetransmitd: Common/Common.a - make -C VoiceTransmit +Common/Common.a: force + $(MAKE) -C Common -GUICommon/GUICommon.a: - make -C GUICommon +ircDDB/IRCDDB.a: force + $(MAKE) -C ircDDB -Common/Common.a: - make -C Common +.PHONY: installdirs +installdirs: force + /bin/mkdir -p $(DESTDIR)$(DATADIR) $(DESTDIR)$(LOGDIR) $(DESTDIR)$(CONFDIR) $(DESTDIR)$(BINDIR) -ircDDB/IRCDDB.a: - make -C ircDDB +.PHONY: install +install: all installdirs +ifeq ($(TARGET), opendv) + useradd --user-group -M --system opendv --shell /bin/false || true -install: all - make -C Data install - make -C APRSTransmit install - make -C ircDDBGateway install - make -C RemoteControl install - make -C StarNetServer install - make -C TextTransmit install - make -C TimerControl install - make -C TimeServer install - make -C VoiceTransmit install - make -C ircDDBGatewayConfig install + # Add the opendv user to the audio group so that it can open audio + # devices when using the audio based drivers such as the Sound Card + # one. Maybe this should be moved to DStarRepeater instead ... + usermod --groups audio --append opendv || true + usermod --groups dialout --append opendv || true + usermod --groups gpio --append opendv || true + mkdir /var/log/opendv || true + chown opendv:opendv /var/log/opendv +endif + $(MAKE) -C Data install + $(MAKE) -C APRSTransmit install + $(MAKE) -C ircDDBGateway install + $(MAKE) -C RemoteControl install + $(MAKE) -C StarNetServer install + $(MAKE) -C TextTransmit install + $(MAKE) -C TimerControl install + $(MAKE) -C TimeServer install + $(MAKE) -C VoiceTransmit install +.PHONY: clean clean: - make -C Common clean - make -C ircDDB clean - make -C GUICommon clean - make -C APRSTransmit clean - make -C ircDDBGateway clean - make -C RemoteControl clean - make -C StarNetServer clean - make -C TextTransmit clean - make -C TimerControl clean - make -C TimeServer clean - make -C VoiceTransmit clean - make -C ircDDBGatewayConfig clean + $(MAKE) -C Common clean + $(MAKE) -C ircDDB clean + $(MAKE) -C APRSTransmit clean + $(MAKE) -C ircDDBGateway clean + $(MAKE) -C RemoteControl clean + $(MAKE) -C StarNetServer clean + $(MAKE) -C TextTransmit clean + $(MAKE) -C TimerControl clean + $(MAKE) -C TimeServer clean + $(MAKE) -C VoiceTransmit clean + $(MAKE) -C ircDDBGatewayConfig clean + +.PHONY: force +force : + @true diff --git a/MakefileGUI b/MakefileGUI new file mode 100644 index 0000000..7bec5e2 --- /dev/null +++ b/MakefileGUI @@ -0,0 +1,95 @@ +ifeq ($(TARGET), opendv) +export DATADIR := "/usr/share/opendv" +export LOGDIR := "/var/log/opendv" +export CONFDIR := "/etc" +export BINDIR := "/usr/sbin" +else +export DATADIR := "/usr/share/ircddbgateway" +export LOGDIR := "/var/log" +export CONFDIR := "/etc" +export BINDIR := "/usr/bin" +endif + +# Add -DDCS_LINK to the end of the CFLAGS line below to add DCS linking to StarNet +# Add -DDEXTRA_LINK to the end of the CFLAGS line below to add DExtra linking to StarNet + +# Add -DUSE_GPS to the end of the CFLAGS line to enable the use of gpsd, and add -lgps to +# end of the LIBS and GUILIBS lines. + +export CXX := $(shell wx-config --cxx) +export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)' +export GUILIBS := $(shell wx-config --libs adv,core,base) +export LIBS := $(shell wx-config --libs base,net) +export LDFLAGS := + +.PHONY: all +all: ircDDBGateway/ircddbgateway ircDDBGatewayConfig/ircddbgatewayconfig APRSTransmit/aprstransmitd RemoteControl/remotecontrol \ + StarNetServer/starnetserver TextTransmit/texttransmitd TimerControl/timercontrol TimeServer/timeserver VoiceTransmit/voicetransmitd + +ircDDBGateway/ircddbgateway: GUICommon/GUICommon.a Common/Common.a ircDDB/IRCDDB.a force + $(MAKE) -C ircDDBGateway -f MakefileGUI + +ircDDBGatewayConfig/ircddbgatewayconfig: GUICommon/GUICommon.a Common/Common.a force + $(MAKE) -C ircDDBGatewayConfig + +APRSTransmit/aprstransmitd: Common/Common.a force + $(MAKE) -C APRSTransmit + +RemoteControl/remotecontrol: Common/Common.a force + $(MAKE) -C RemoteControl -f MakefileGUI + +StarNetServer/starnetserver: Common/Common.a ircDDB/IRCDDB.a force + $(MAKE) -C StarNetServer -f MakefileGUI + +TextTransmit/texttransmitd: Common/Common.a force + $(MAKE) -C TextTransmit + +TimerControl/timercontrol: Common/Common.a GUICommon/GUICommon.a force + $(MAKE) -C TimerControl -f MakefileGUI + +TimeServer/timeserver: Common/Common.a GUICommon/GUICommon.a force + $(MAKE) -C TimeServer -f MakefileGUI + +VoiceTransmit/voicetransmitd: Common/Common.a force + $(MAKE) -C VoiceTransmit + +GUICommon/GUICommon.a: force + $(MAKE) -C GUICommon + +Common/Common.a: force + $(MAKE) -C Common + +ircDDB/IRCDDB.a: force + $(MAKE) -C ircDDB + +.PHONY: install +install: all + $(MAKE) -C Data install + $(MAKE) -C APRSTransmit install + $(MAKE) -C ircDDBGateway -f MakefileGUI install + $(MAKE) -C RemoteControl -f MakefileGUI install + $(MAKE) -C StarNetServer -f MakefileGUI install + $(MAKE) -C TextTransmit install + $(MAKE) -C TimerControl -f MakefileGUI install + $(MAKE) -C TimeServer -f MakefileGUI install + $(MAKE) -C VoiceTransmit install + $(MAKE) -C ircDDBGatewayConfig install + +.PHONY: clean +clean: + $(MAKE) -C Common clean + $(MAKE) -C ircDDB clean + $(MAKE) -C GUICommon clean + $(MAKE) -C APRSTransmit clean + $(MAKE) -C ircDDBGateway -f MakefileGUI clean + $(MAKE) -C RemoteControl -f MakefileGUI clean + $(MAKE) -C StarNetServer -f MakefileGUI clean + $(MAKE) -C TextTransmit clean + $(MAKE) -C TimerControl -f MakefileGUI clean + $(MAKE) -C TimeServer -f MakefileGUI clean + $(MAKE) -C VoiceTransmit clean + $(MAKE) -C ircDDBGatewayConfig clean + +.PHONY: force +force: + true; diff --git a/README.md b/README.md index d099084..a90b421 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This is the ircDDB Gateway. It allows a D-Star Repeater to interface into callsi * XLX reflectors. * CCS7 routing. * D-RATS data transfers. -* Gateway DPRS data to aprs.fi. +* Gateway DPRS data to APRS-IS. * Full multi lingual text and voice announcements. * DTMF or UR call control. * Remote control interface. @@ -22,3 +22,24 @@ There are many external programs that allow for inserting voice or text messages They all build on 32-bit and 64-bit Linux as well as on Windows using Visual Studio 2017 on x86 and x64. This software is licenced under the GPL v2. + +# Build and installing +## Regular build +```shell +make +make -f MakefileGUI #only required if you want to build the GUI programs +sudo make install +``` +## Drop-in replacement for dl5di OpenDV packages +This will conpile the program to be used as a drop in replacement for the no longer maintained DL5DI OpenDV packages. Systemd files to run ircddbgatewayd as daemon will also be installed. +```shell +export TARGET=opendv +make +make -f MakefileGUI #only required if you want to build the GUI programs +sudo make install +``` +Now you should edit the configuration in the file /etc/ircddbgateway to match your needs. +```shell +sudo systemctl enable ircddbgatewayd.service #enable service +sudo service ircddbgatewayd start +``` diff --git a/RemoteControl/Makefile b/RemoteControl/Makefile index 48a2a54..f5382c2 100644 --- a/RemoteControl/Makefile +++ b/RemoteControl/Makefile @@ -1,17 +1,24 @@ OBJECTS = RemoteControlAppD.o RemoteControlCallsignData.o RemoteControlConfig.o RemoteControlLinkData.o RemoteControlRemoteControlHandler.o \ RemoteControlRepeaterData.o RemoteControlStarNetGroup.o RemoteControlStarNetUser.o +.PHONY: all all: remotecontrold -remotecontrold: $(OBJECTS) +remotecontrold: $(OBJECTS) ../Common/Common.a $(CXX) $(OBJECTS) ../Common/Common.a $(LDFLAGS) $(LIBS) -o remotecontrold +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../Common -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common $< > $*.d +.PHONY: install install: - install -g bin -o root -m 0775 remotecontrold $(BINDIR) + install -g root -o root -m 0755 remotecontrold $(DESTDIR)$(BINDIR) +.PHONY: clean clean: $(RM) remotecontrold *.o *.d *.bak *~ +../Common/Common.a: diff --git a/RemoteControl/MakefileGUI b/RemoteControl/MakefileGUI new file mode 100644 index 0000000..ed75ed9 --- /dev/null +++ b/RemoteControl/MakefileGUI @@ -0,0 +1,26 @@ +OBJECTS = RemoteControlApp.o RemoteControlCallsignData.o RemoteControlConfig.o RemoteControlFrame.o RemoteControlLinkData.o \ + RemoteControlPreferences.o RemoteControlRemoteControlHandler.o RemoteControlRemoteSet.o RemoteControlRepeaterData.o \ + RemoteControlRepeaterPanel.o RemoteControlStarNetGroup.o RemoteControlStarNetPanel.o RemoteControlStarNetUser.o + +.PHONY: all +all: remotecontrol + +remotecontrol: $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a + $(CXX) $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a $(LDFLAGS) $(GUILIBS) -o remotecontrol + +-include $(OBJECTS:.o=.d) + +%.o: %.cpp + $(CXX) $(CFLAGS) -I../Common -I../GUICommon -c -o $@ $< + $(CXX) -MM $(CFLAGS) -I../Common -I../GUICommon $< > $*.d + +.PHONY: install +install: + install -g bin -o root -m 0775 remotecontrol $(BINDIR) + +.PHONY: clean +clean: + $(RM) remotecontrol *.o *.d *.bak *~ + +../GUICommon/GUICommon.a: +../Common/Common.a: diff --git a/RemoteControl/RemoteControl.vcxproj b/RemoteControl/RemoteControl.vcxproj index ba4020a..4b5b287 100644 --- a/RemoteControl/RemoteControl.vcxproj +++ b/RemoteControl/RemoteControl.vcxproj @@ -22,29 +22,29 @@ {F7756875-1F58-4006-AD55-5C963AB682C0} RemoteControl Win32Proj - 10.0.16299.0 + 10.0 Application - v141 + v142 Unicode true Application - v141 + v142 Unicode true Application - v141 + v142 Unicode Application - v141 + v142 Unicode @@ -80,9 +80,11 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ false + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) false + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) diff --git a/StarNetServer/Makefile b/StarNetServer/Makefile index f49f112..a12de40 100644 --- a/StarNetServer/Makefile +++ b/StarNetServer/Makefile @@ -1,16 +1,24 @@ OBJECTS = StarNetServerAppD.o StarNetServerConfig.o StarNetServerThread.o StarNetServerThreadHelper.o +.PHONY: all all: starnetserverd -starnetserverd: $(OBJECTS) +starnetserverd: $(OBJECTS) ../Common/Common.a ../ircDDB/IRCDDB.a $(CXX) $(OBJECTS) ../Common/Common.a ../ircDDB/IRCDDB.a $(LDFLAGS) $(LIBS) -o starnetserverd +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../Common -I../ircDDB -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common -I../ircDDB $< > $*.d +.PHONY: install install: - install -g bin -o root -m 0775 starnetserverd $(BINDIR) + install -g root -o root -m 0755 starnetserverd $(DESTDIR)$(BINDIR) +.PHONY: clean clean: $(RM) starnetserverd *.o *.d *.bak *~ +../Common/Common.a: +../ircDDB/IRCDDB.a: diff --git a/StarNetServer/MakefileGUI b/StarNetServer/MakefileGUI new file mode 100644 index 0000000..61fe271 --- /dev/null +++ b/StarNetServer/MakefileGUI @@ -0,0 +1,26 @@ +OBJECTS = StarNetServerApp.o StarNetServerCallsignSet.o StarNetServerConfig.o StarNetServerFrame.o StarNetServerIrcDDBSet.o \ + StarNetServerLogRedirect.o StarNetServerMiscellaneousSet.o StarNetServerPreferences.o StarNetServerThread.o \ + StarNetServerThreadHelper.o + +.PHONY: all +all: starnetserver + +starnetserver: $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a + $(CXX) $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a ../ircDDB/IRCDDB.a $(LDFLAGS) $(GUILIBS) -o starnetserver + +-include $(OBJECTS:.o=.d) + +%.o: %.cpp + $(CXX) $(CFLAGS) -I../Common -I../GUICommon -I../ircDDB -c -o $@ $< + $(CXX) -MM $(CFLAGS) -I../Common -I../GUICommon -I../ircDDB $< > $*.d + +.PHONY: install +install: + install -g bin -o root -m 0775 starnetserver $(BINDIR) + +.PHONY: clean +clean: + $(RM) starnetserver *.o *.d *.bak *~ + +../GUICommon/GUICommon.a: +../Common/Common.a: diff --git a/StarNetServer/StarNetServer.vcxproj b/StarNetServer/StarNetServer.vcxproj index 4c7a44c..7536891 100644 --- a/StarNetServer/StarNetServer.vcxproj +++ b/StarNetServer/StarNetServer.vcxproj @@ -22,29 +22,29 @@ {4E9989C8-80D4-4F6E-BCA1-754DCED3AF5F} StarNetServer Win32Proj - 10.0.16299.0 + 10.0 Application - v141 + v142 Unicode true Application - v141 + v142 Unicode true Application - v141 + v142 Unicode Application - v141 + v142 Unicode @@ -80,9 +80,11 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ false + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) false + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) diff --git a/TextTransmit/Makefile b/TextTransmit/Makefile index c4e70bc..c1212cb 100644 --- a/TextTransmit/Makefile +++ b/TextTransmit/Makefile @@ -1,16 +1,23 @@ OBJECTS = TextTransmit.o +.PHONY: all all: texttransmitd -texttransmitd: $(OBJECTS) +texttransmitd: $(OBJECTS) ../Common/Common.a $(CXX) $(OBJECTS) ../Common/Common.a $(LDFLAGS) $(LIBS) -o texttransmitd +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../Common -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common $< > $*.d +.PHONY: install install: - install -g bin -o root -m 0775 texttransmitd $(BINDIR) + install -g root -o root -m 0755 texttransmitd $(DESTDIR)$(BINDIR) +.PHONY: clean clean: $(RM) texttransmitd *.o *.d *.bak *~ +../Common/Common.a: diff --git a/TextTransmit/TextTransmit.vcxproj b/TextTransmit/TextTransmit.vcxproj index 9f636d8..c8c556e 100644 --- a/TextTransmit/TextTransmit.vcxproj +++ b/TextTransmit/TextTransmit.vcxproj @@ -22,29 +22,29 @@ {AFB9BCE5-0D37-4707-93A1-DA14E39F2773} TextTransmit Win32Proj - 10.0.16299.0 + 10.0 Application - v141 + v142 Unicode true Application - v141 + v142 Unicode true Application - v141 + v142 Unicode Application - v141 + v142 Unicode @@ -80,9 +80,11 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ false + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) false + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) diff --git a/TimeServer/Makefile b/TimeServer/Makefile index 69b2339..d5f5a74 100644 --- a/TimeServer/Makefile +++ b/TimeServer/Makefile @@ -1,16 +1,23 @@ OBJECTS = TimeServerD.o TimeServerConfig.o TimeServerThread.o TimeServerThreadHelper.o +.PHONY: all all: timeserverd -timeserverd: $(OBJECTS) +timeserverd: $(OBJECTS) ../Common/Common.a $(CXX) $(OBJECTS) ../Common/Common.a $(LDFLAGS) $(LIBS) -o timeserverd +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../Common -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common $< > $*.d +.PHONY: install install: - install -g bin -o root -m 0775 timeserverd $(BINDIR) + install -g root -o root -m 0755 timeserverd $(DESTDIR)$(BINDIR) +.PHONY: clean clean: $(RM) timeserverd *.o *.d *.bak *~ +../Common/Common.a: diff --git a/TimeServer/MakefileGUI b/TimeServer/MakefileGUI new file mode 100644 index 0000000..9982b46 --- /dev/null +++ b/TimeServer/MakefileGUI @@ -0,0 +1,25 @@ +OBJECTS = TimeServerApp.o TimeServerAnnouncementsSet.o TimeServerConfig.o TimeServerFrame.o TimeServerGatewaySet.o TimeServerLogRedirect.o \ + TimeServerPreferences.o TimeServerThread.o TimeServerThreadHelper.o + +.PHONY: all +all: timeserver + +timeserver: $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a + $(CXX) $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a $(LDFLAGS) $(GUILIBS) -o timeserver + +-include $(OBJECTS:.o=.d) + +%.o: %.cpp + $(CXX) $(CFLAGS) -I../Common -I../GUICommon -c -o $@ $< + $(CXX) -MM $(CFLAGS) -I../Common -I../GUICommon $< > $*.d + +.PHONY: install +install: + install -g bin -o root -m 0775 timeserver $(BINDIR) + +.PHONY: clean +clean: + $(RM) timeserver *.o *.d *.bak *~ + +../GUICommon/GUICommon.a: +../Common/Common.a: diff --git a/TimeServer/TimeServer.vcxproj b/TimeServer/TimeServer.vcxproj index ff96b71..2676d4d 100644 --- a/TimeServer/TimeServer.vcxproj +++ b/TimeServer/TimeServer.vcxproj @@ -22,29 +22,29 @@ {99F336A5-6E33-4919-BF75-D6D8BA26345E} TimeServer Win32Proj - 10.0.16299.0 + 10.0 Application - v141 + v142 Unicode true Application - v141 + v142 Unicode true Application - v141 + v142 Unicode Application - v141 + v142 Unicode @@ -80,9 +80,11 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ false + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) false + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) diff --git a/TimerControl/Makefile b/TimerControl/Makefile index 53877ff..9cd2b99 100644 --- a/TimerControl/Makefile +++ b/TimerControl/Makefile @@ -1,17 +1,25 @@ OBJECTS = TimerControlAppD.o TimerControlConfig.o TimerControlItemFile.o TimerControlRemoteControlHandler.o TimerControlThread.o \ TimerControlThreadHelper.o +.PHONY: all all: timercontrold -timercontrold: $(OBJECTS) +timercontrold: $(OBJECTS) ../Common/Common.a $(CXX) $(OBJECTS) ../Common/Common.a $(LDFLAGS) $(LIBS) -o timercontrold +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../Common -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common $< > $*.d +.PHONY: install install: - install -g bin -o root -m 0775 timercontrold $(BINDIR) + install -g root -o root -m 0755 timercontrold $(DESTDIR)$(BINDIR) +.PHONY: clean clean: $(RM) timercontrold *.o *.d *.bak *~ +../Common/Common.a: + diff --git a/TimerControl/MakefileGUI b/TimerControl/MakefileGUI new file mode 100644 index 0000000..fdcccc0 --- /dev/null +++ b/TimerControl/MakefileGUI @@ -0,0 +1,26 @@ +OBJECTS = TimerControlApp.o TimerControlConfig.o TimerControlFrame.o TimerControlItemFile.o TimerControlPreferences.o \ + TimerControlRemoteControlHandler.o TimerControlRemoteSet.o TimerControlRepeaterPanel.o TimerControlThread.o \ + TimerControlThreadHelper.o + +.PHONY: all +all: timercontrol + +timercontrol: $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a + $(CXX) $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a $(LDFLAGS) $(GUILIBS) -o timercontrol + +-include $(OBJECTS:.o=.d) + +%.o: %.cpp + $(CXX) $(CFLAGS) -I../Common -I../GUICommon -c -o $@ $< + $(CXX) -MM $(CFLAGS) -I../Common -I../GUICommon $< > $*.d + +.PHONY: install +install: + install -g bin -o root -m 0775 timercontrol $(BINDIR) + +.PHONY: clean +clean: + $(RM) timercontrol *.o *.d *.bak *~ + +../GUICommon/GUICommon.a: +../Common/Common.a: diff --git a/TimerControl/TimerControl.vcxproj b/TimerControl/TimerControl.vcxproj index 96779de..61543c9 100644 --- a/TimerControl/TimerControl.vcxproj +++ b/TimerControl/TimerControl.vcxproj @@ -22,29 +22,29 @@ {68CFAB6D-AED3-4B8A-BCB3-EE4136CA00A3} TimerControl Win32Proj - 10.0.16299.0 + 10.0 Application - v141 + v142 Unicode true Application - v141 + v142 Unicode true Application - v141 + v142 Unicode Application - v141 + v142 Unicode @@ -80,9 +80,11 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ false + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) false + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) diff --git a/VoiceTransmit/Makefile b/VoiceTransmit/Makefile index 71cb8ef..0733fc6 100644 --- a/VoiceTransmit/Makefile +++ b/VoiceTransmit/Makefile @@ -1,16 +1,23 @@ OBJECTS = VoiceStore.o VoiceTransmit.o +.PHONY: all all: voicetransmitd -voicetransmitd: $(OBJECTS) +voicetransmitd: $(OBJECTS) ../Common/Common.a $(CXX) $(OBJECTS) ../Common/Common.a $(LDFLAGS) $(LIBS) -o voicetransmitd +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../Common -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common $< > $*.d +.PHONY: install install: - install -g bin -o root -m 0775 voicetransmitd $(BINDIR) + install -g root -o root -m 0755 voicetransmitd $(DESTDIR)$(BINDIR) +.PHONY: clean clean: $(RM) voicetransmitd *.o *.d *.bak *~ +../Common/Common.a: diff --git a/VoiceTransmit/VoiceTransmit.vcxproj b/VoiceTransmit/VoiceTransmit.vcxproj index c0af277..2c67175 100644 --- a/VoiceTransmit/VoiceTransmit.vcxproj +++ b/VoiceTransmit/VoiceTransmit.vcxproj @@ -22,29 +22,29 @@ {27D44C4F-6849-4E15-A5BB-0B54BA296D98} VoiceTransmit Win32Proj - 10.0.16299.0 + 10.0 Application - v141 + v142 Unicode true Application - v141 + v142 Unicode true Application - v141 + v142 Unicode Application - v141 + v142 Unicode @@ -80,9 +80,11 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ false + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) false + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) diff --git a/ircDDB/Makefile b/ircDDB/Makefile index b841a5e..5a6602c 100644 --- a/ircDDB/Makefile +++ b/ircDDB/Makefile @@ -1,14 +1,19 @@ OBJECTS = IRCClient.o IRCDDBApp.o IRCDDBClient.o IRCDDB.o IRCDDBMultiClient.o IRCMessage.o IRCMessageQueue.o IRCProtocol.o IRCReceiver.o \ IRCutils.o +.PHONY: all all: IRCDDB.a IRCDDB.a: $(OBJECTS) $(AR) rcs IRCDDB.a $(OBJECTS) +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) $< > $*.d +.PHONY: clean clean: $(RM) IRCDDB.a *.o *.d *.bak *~ diff --git a/ircDDB/ircDDB.vcxproj b/ircDDB/ircDDB.vcxproj index 75e4f54..fc1ca68 100644 --- a/ircDDB/ircDDB.vcxproj +++ b/ircDDB/ircDDB.vcxproj @@ -22,29 +22,29 @@ {276BC54D-5581-4A0C-AFD5-A5BDC947F0AD} ircDDB Win32Proj - 10.0.16299.0 + 10.0 StaticLibrary - v141 + v142 Unicode true StaticLibrary - v141 + v142 Unicode true StaticLibrary - v141 + v142 Unicode StaticLibrary - v141 + v142 Unicode @@ -77,6 +77,10 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) + + + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) diff --git a/ircDDBGateway/IRCDDBGatewayApp.cpp b/ircDDBGateway/IRCDDBGatewayApp.cpp index 9efde78..930b1d5 100644 --- a/ircDDBGateway/IRCDDBGatewayApp.cpp +++ b/ircDDBGateway/IRCDDBGatewayApp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015,2018 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2020 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 @@ -40,6 +40,7 @@ wxIMPLEMENT_APP(CIRCDDBGatewayApp); const wxChar* NAME_PARAM = wxT("Gateway Name"); const wxChar* NOLOGGING_SWITCH = wxT("nolog"); +const wxChar* DEBUG_SWITCH = wxT("debug"); const wxChar* GUI_SWITCH = wxT("gui"); const wxChar* LOGDIR_OPTION = wxT("logdir"); const wxChar* CONFDIR_OPTION = wxT("confdir"); @@ -50,6 +51,7 @@ CIRCDDBGatewayApp::CIRCDDBGatewayApp() : wxApp(), m_name(), m_nolog(false), +m_debug(false), m_gui(false), m_logDir(), m_confDir(), @@ -89,6 +91,14 @@ bool CIRCDDBGatewayApp::OnInit() wxLog* log = new CLogger(m_logDir, logBaseName); wxLog::SetActiveTarget(log); + + if (m_debug) { + wxLog::SetVerbose(true); + wxLog::SetLogLevel(wxLOG_Debug); + } else { + wxLog::SetVerbose(false); + wxLog::SetLogLevel(wxLOG_Message); + } } else { new wxLogNull; } @@ -161,8 +171,10 @@ int CIRCDDBGatewayApp::OnExit() wxLogInfo(APPLICATION_NAME + wxT(" is exiting")); - //m_thread->kill(); - wxGetApp().GetTopWindow()->Close(); + m_thread->kill(); + wxWindow * topWin = wxGetApp().GetTopWindow(); + if (topWin != NULL) + topWin->Close(); delete m_config; @@ -174,6 +186,7 @@ int CIRCDDBGatewayApp::OnExit() void CIRCDDBGatewayApp::OnInitCmdLine(wxCmdLineParser& parser) { parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); + parser.AddSwitch(DEBUG_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); parser.AddSwitch(GUI_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); parser.AddOption(CONFDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); @@ -188,6 +201,7 @@ bool CIRCDDBGatewayApp::OnCmdLineParsed(wxCmdLineParser& parser) return false; m_nolog = parser.Found(NOLOGGING_SWITCH); + m_debug = parser.Found(DEBUG_SWITCH); m_gui = parser.Found(GUI_SWITCH); wxString logDir; @@ -254,15 +268,15 @@ void CIRCDDBGatewayApp::createThread() thread->setGateway(gatewayType, gatewayCallsign, gatewayAddress); - wxString aprsHostname; + wxString aprsAddress; unsigned int aprsPort; bool aprsEnabled; - m_config->getDPRS(aprsEnabled, aprsHostname, aprsPort); - wxLogInfo(wxT("APRS enabled: %d, host: %s:%u"), int(aprsEnabled), aprsHostname.c_str(), aprsPort); + m_config->getDPRS(aprsEnabled, aprsAddress, aprsPort); + wxLogInfo(wxT("APRS enabled: %d, host: %s:%u"), int(aprsEnabled), aprsAddress.c_str(), aprsPort); CAPRSWriter* aprs = NULL; - if (aprsEnabled && !gatewayCallsign.IsEmpty() && !aprsHostname.IsEmpty() && aprsPort != 0U) { - aprs = new CAPRSWriter(aprsHostname, aprsPort, gatewayCallsign, gatewayAddress); + if (aprsEnabled && !aprsAddress.IsEmpty() && aprsPort != 0U) { + aprs = new CAPRSWriter(aprsAddress, aprsPort, gatewayCallsign); bool res = aprs->open(); if (!res) @@ -276,6 +290,11 @@ void CIRCDDBGatewayApp::createThread() m_config->getMiscellaneous(language, infoEnabled, echoEnabled, logEnabled, dratsEnabled, dtmfEnabled); wxLogInfo(wxT("Language: %d, info enabled: %d, echo enabled: %d, log enabled : %d, D-RATS enabled: %d, DTMF control enabled: %d"), int(language), int(infoEnabled), int(echoEnabled), int(logEnabled), int(dratsEnabled), int(dtmfEnabled)); + bool gpsdEnabled; + wxString gpsdAddress, gpsdPort; + m_config->getGPSD(gpsdEnabled, gpsdAddress, gpsdPort); + wxLogInfo(wxT("GPSD: %d, address: %s, port: %s"), int(gpsdEnabled), gpsdAddress.c_str(), gpsdPort.c_str()); + CIcomRepeaterProtocolHandler* icomRepeaterHandler = NULL; CHBRepeaterProtocolHandler* hbRepeaterHandler = NULL; CDummyRepeaterProtocolHandler* dummyRepeaterHandler = NULL; @@ -351,15 +370,23 @@ void CIRCDDBGatewayApp::createThread() wxLogInfo(wxT("Repeater 1 bands: %u %u %u"), band11, band12, band13); thread->addRepeater(callsign1, repeaterBand1, repeaterAddress1, repeaterPort1, repeaterType1, reflector1, atStartup1, reconnect1, dratsEnabled, frequency1, offset1, range1, latitude1, longitude1, agl1, description11, description12, url1, icomRepeaterHandler, band11, band12, band13); - if (aprs != NULL) - aprs->setPort(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign1, repeaterBand1, frequency1, offset1, range1, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); + } icomCount++; } else if (repeaterType1 == HW_HOMEBREW && hbRepeaterHandler != NULL) { thread->addRepeater(callsign1, repeaterBand1, repeaterAddress1, repeaterPort1, repeaterType1, reflector1, atStartup1, reconnect1, dratsEnabled, frequency1, offset1, range1, latitude1, longitude1, agl1, description11, description12, url1, hbRepeaterHandler); - if (aprs != NULL) - aprs->setPort(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign1, repeaterBand1, frequency1, offset1, range1, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); + } } else if (repeaterType1 == HW_DUMMY && dummyRepeaterHandler != NULL) { thread->addRepeater(callsign1, repeaterBand1, repeaterAddress1, repeaterPort1, repeaterType1, reflector1, atStartup1, reconnect1, dratsEnabled, frequency1, offset1, range1, latitude1, longitude1, agl1, description11, description12, url1, dummyRepeaterHandler); } @@ -439,15 +466,23 @@ void CIRCDDBGatewayApp::createThread() wxLogInfo(wxT("Repeater 2 bands: %u %u %u"), band21, band22, band23); thread->addRepeater(callsign2, repeaterBand2, repeaterAddress2, repeaterPort2, repeaterType2, reflector2, atStartup2, reconnect2, dratsEnabled, frequency2, offset2, range2, latitude2, longitude2, agl2, description21, description22, url2, icomRepeaterHandler, band21, band22, band23); - if (aprs != NULL) - aprs->setPort(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl2); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign2, repeaterBand2, frequency2, offset2, range2, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl2); + } icomCount++; } else if (repeaterType2 == HW_HOMEBREW && hbRepeaterHandler != NULL) { thread->addRepeater(callsign2, repeaterBand2, repeaterAddress2, repeaterPort2, repeaterType2, reflector2, atStartup2, reconnect2, dratsEnabled, frequency2, offset2, range2, latitude2, longitude2, agl2, description21, description22, url2, hbRepeaterHandler); - if (aprs != NULL) - aprs->setPort(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl2); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign2, repeaterBand2, frequency2, offset2, range2, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl2); + } } else if (repeaterType2 == HW_DUMMY && dummyRepeaterHandler != NULL) { thread->addRepeater(callsign2, repeaterBand2, repeaterAddress2, repeaterPort2, repeaterType2, reflector2, atStartup2, reconnect2, dratsEnabled, frequency2, offset2, range2, latitude2, longitude2, agl2, description21, description22, url2, dummyRepeaterHandler); } @@ -531,15 +566,23 @@ void CIRCDDBGatewayApp::createThread() wxLogInfo(wxT("Repeater 3 bands: %u %u %u"), band31, band32, band33); thread->addRepeater(callsign3, repeaterBand3, repeaterAddress3, repeaterPort3, repeaterType3, reflector3, atStartup3, reconnect3, dratsEnabled, frequency3, offset3, range3, latitude3, longitude3, agl3, description31, description32, url3, icomRepeaterHandler, band31, band32, band33); - if (aprs != NULL) - aprs->setPort(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign3, repeaterBand3, frequency3, offset3, range3, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); + } icomCount++; } else if (repeaterType3 == HW_HOMEBREW && hbRepeaterHandler != NULL) { thread->addRepeater(callsign3, repeaterBand3, repeaterAddress3, repeaterPort3, repeaterType3, reflector3, atStartup3, reconnect3, dratsEnabled, frequency3, offset3, range3, latitude3, longitude3, agl3, description31, description32, url3, hbRepeaterHandler); - if (aprs != NULL) - aprs->setPort(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign3, repeaterBand3, frequency3, offset3, range3, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); + } } else if (repeaterType3 == HW_DUMMY && dummyRepeaterHandler != NULL) { thread->addRepeater(callsign3, repeaterBand3, repeaterAddress3, repeaterPort3, repeaterType3, reflector3, atStartup3, reconnect3, dratsEnabled, frequency3, offset3, range3, latitude3, longitude3, agl3, description31, description32, url3, dummyRepeaterHandler); } @@ -627,15 +670,23 @@ void CIRCDDBGatewayApp::createThread() wxLogInfo(wxT("Repeater 4 bands: %u %u %u"), band41, band42, band43); thread->addRepeater(callsign4, repeaterBand4, repeaterAddress4, repeaterPort4, repeaterType4, reflector4, atStartup4, reconnect4, dratsEnabled, frequency4, offset4, range4, latitude4, longitude4, agl4, description41, description42, url4, icomRepeaterHandler, band41, band42, band43); - if (aprs != NULL) - aprs->setPort(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign4, repeaterBand4, frequency4, offset4, range4, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); + } icomCount++; } else if (repeaterType4 == HW_HOMEBREW && hbRepeaterHandler != NULL) { thread->addRepeater(callsign4, repeaterBand4, repeaterAddress4, repeaterPort4, repeaterType4, reflector4, atStartup4, reconnect4, dratsEnabled, frequency4, offset4, range4, latitude4, longitude4, agl4, description41, description42, url4, hbRepeaterHandler); - if (aprs != NULL) - aprs->setPort(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign4, repeaterBand4, frequency4, offset4, range4, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); + } } else if (repeaterType4 == HW_DUMMY && dummyRepeaterHandler != NULL) { thread->addRepeater(callsign4, repeaterBand4, repeaterAddress4, repeaterPort4, repeaterType4, reflector4, atStartup4, reconnect4, dratsEnabled, frequency4, offset4, range4, latitude4, longitude4, agl4, description41, description42, url4, dummyRepeaterHandler); } @@ -650,7 +701,7 @@ void CIRCDDBGatewayApp::createThread() wxString ircDDBHostname3, ircDDBUsername3, ircDDBPassword3; wxString ircDDBHostname4, ircDDBUsername4, ircDDBPassword4; - m_config->getIrcDDB(ircDDBEnabled1, ircDDBHostname1, ircDDBUsername1, ircDDBPassword1); + m_config->getIrcDDB1(ircDDBEnabled1, ircDDBHostname1, ircDDBUsername1, ircDDBPassword1); wxLogInfo(wxT("ircDDB 1 enabled: %d, host: %s, username: %s"), int(ircDDBEnabled1), ircDDBHostname1.c_str(), ircDDBUsername1.c_str()); m_config->getIrcDDB2(ircDDBEnabled2, ircDDBHostname2, ircDDBUsername2, ircDDBPassword2); @@ -837,10 +888,9 @@ void CIRCDDBGatewayApp::createThread() wxLogInfo(wxT("DCS enabled: %d, CCS enabled: %d, server: %s"), int(dcsEnabled), int(ccsEnabled), ccsHost.c_str()); bool xlxEnabled; - bool xlxOverrideLocal; wxString xlxHostsFileUrl; - m_config->getXLX(xlxEnabled, xlxOverrideLocal, xlxHostsFileUrl); - wxLogInfo(wxT("XLX enabled: %d, Override Local %d, Hosts file url: %s"), int(xlxEnabled), int(xlxOverrideLocal), xlxHostsFileUrl.c_str()); + m_config->getXLX(xlxEnabled, xlxHostsFileUrl); + wxLogInfo(wxT("XLX enabled: %d, Hosts file url: %s"), int(xlxEnabled), xlxHostsFileUrl.c_str()); if (repeaterBand1.Len() > 1U || repeaterBand2.Len() > 1U || repeaterBand3.Len() > 1U || repeaterBand4.Len() > 1U) { @@ -910,7 +960,7 @@ void CIRCDDBGatewayApp::createThread() thread->setDExtra(dextraEnabled, dextraMaxDongles); thread->setDCS(dcsEnabled); thread->setCCS(ccsEnabled, ccsHost); - thread->setXLX(xlxEnabled, xlxOverrideLocal, xlxEnabled ? CXLXHostsFileDownloader::Download(xlxHostsFileUrl) : wxString(wxEmptyString)); + thread->setXLX(xlxEnabled, xlxEnabled ? CXLXHostsFileDownloader::Download(xlxHostsFileUrl) : wxString(wxEmptyString)); thread->setInfoEnabled(infoEnabled); thread->setEchoEnabled(echoEnabled); thread->setDTMFEnabled(dtmfEnabled); diff --git a/ircDDBGateway/IRCDDBGatewayApp.h b/ircDDBGateway/IRCDDBGatewayApp.h index 3d11ba6..2bf5a3d 100644 --- a/ircDDBGateway/IRCDDBGatewayApp.h +++ b/ircDDBGateway/IRCDDBGatewayApp.h @@ -54,6 +54,7 @@ public: private: wxString m_name; bool m_nolog; + bool m_debug; bool m_gui; wxString m_logDir; wxString m_confDir; diff --git a/ircDDBGateway/IRCDDBGatewayAppD.cpp b/ircDDBGateway/IRCDDBGatewayAppD.cpp index e51efac..4a3c900 100644 --- a/ircDDBGateway/IRCDDBGatewayAppD.cpp +++ b/ircDDBGateway/IRCDDBGatewayAppD.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013,2015,2018 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2013,2015,2018,2020 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 @@ -26,6 +26,7 @@ #include "APRSWriter.h" #include "Version.h" #include "Logger.h" +#include "ConsoleLogger.h" #include "IRCDDB.h" #include "IRCDDBClient.h" #include "IRCDDBMultiClient.h" @@ -44,11 +45,13 @@ const wxChar* NAME_PARAM = wxT("Gateway Name"); const wxChar* NOLOGGING_SWITCH = wxT("nolog"); +const wxChar* DEBUG_SWITCH = wxT("debug"); const wxChar* LOGDIR_OPTION = wxT("logdir"); const wxChar* CONFDIR_OPTION = wxT("confdir"); const wxChar* DAEMON_SWITCH = wxT("daemon"); +const wxChar* FGROUND_SWITCH = wxT("foreground"); -const wxString LOG_BASE_NAME = wxT("ircddbgatewayd"); +const wxString LOG_BASE_NAME = wxT("ircDDBGateway"); static CIRCDDBGatewayAppD* m_gateway = NULL; @@ -67,7 +70,9 @@ int main(int argc, char** argv) wxCmdLineParser parser(argc, argv); parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); + parser.AddSwitch(DEBUG_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); parser.AddSwitch(DAEMON_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); + parser.AddSwitch(FGROUND_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); parser.AddOption(CONFDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); parser.AddParam(NAME_PARAM, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); @@ -78,8 +83,10 @@ int main(int argc, char** argv) return 0; } - bool nolog = parser.Found(NOLOGGING_SWITCH); - bool daemon = parser.Found(DAEMON_SWITCH); + bool nolog = parser.Found(NOLOGGING_SWITCH); + bool debug = parser.Found(DEBUG_SWITCH); + bool daemon = parser.Found(DAEMON_SWITCH); + bool foreground = parser.Found(FGROUND_SWITCH); wxString logDir; bool found = parser.Found(LOGDIR_OPTION, &logDir); @@ -95,6 +102,12 @@ int main(int argc, char** argv) if (parser.GetParamCount() > 0U) name = parser.GetParam(0U); + if (daemon && foreground) { + ::fprintf(stderr, "ircddbgatewayd: -daemon and -foreground are mutually exclusive, exiting\n"); + ::wxUninitialize(); + return 1; + } + if (daemon) { pid_t pid = ::fork(); @@ -135,7 +148,7 @@ int main(int argc, char** argv) ::fclose(fp); } - m_gateway = new CIRCDDBGatewayAppD(nolog, logDir, confDir, name); + m_gateway = new CIRCDDBGatewayAppD(nolog, debug, foreground, logDir, confDir, name); if (!m_gateway->init()) { ::wxUninitialize(); return 1; @@ -154,9 +167,11 @@ int main(int argc, char** argv) return 0; } -CIRCDDBGatewayAppD::CIRCDDBGatewayAppD(bool nolog, const wxString& logDir, const wxString& confDir, const wxString& name) : +CIRCDDBGatewayAppD::CIRCDDBGatewayAppD(bool nolog, bool debug, bool foreground, const wxString& logDir, const wxString& confDir, const wxString& name) : m_name(name), m_nolog(nolog), +m_debug(debug), +m_foreground(foreground), m_logDir(logDir), m_confDir(confDir), m_thread(NULL), @@ -170,7 +185,9 @@ CIRCDDBGatewayAppD::~CIRCDDBGatewayAppD() bool CIRCDDBGatewayAppD::init() { - if (!m_nolog) { + if (m_foreground) { + initLogging(new CConsoleLogger()); + } else if (!m_nolog) { wxString logBaseName = LOG_BASE_NAME; if (!m_name.IsEmpty()) { logBaseName.Append(wxT("_")); @@ -180,8 +197,7 @@ bool CIRCDDBGatewayAppD::init() if (m_logDir.IsEmpty()) m_logDir = wxT(LOG_DIR); - wxLog* log = new CLogger(m_logDir, logBaseName); - wxLog::SetActiveTarget(log); + initLogging(new CLogger(m_logDir, logBaseName)); } else { new wxLogNull; } @@ -200,14 +216,31 @@ bool CIRCDDBGatewayAppD::init() return false; } - wxLogInfo(wxT("Starting ") + APPLICATION_NAME + wxT(" daemon - ") + VERSION); + wxLogMessage(wxT("Starting ") + APPLICATION_NAME + wxT(" daemon - ") + VERSION); // Log the version of wxWidgets and the Operating System wxLogInfo(wxT("Using wxWidgets %d.%d.%d on %s"), wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER, ::wxGetOsDescription().c_str()); + if (!m_nolog && m_foreground) { + wxLogWarning(wxT("Running in foreground, logging to file disabled. Use -nolog when running this application in foreground to suppress this ")); + } + return createThread(); } +void CIRCDDBGatewayAppD::initLogging(wxLog *logger) +{ + wxLog::SetActiveTarget(logger); + + if (m_debug) { + wxLog::SetVerbose(true); + wxLog::SetLogLevel(wxLOG_Debug); + } else { + wxLog::SetVerbose(false); + wxLog::SetLogLevel(wxLOG_Message); + } +} + void CIRCDDBGatewayAppD::run() { m_thread->run(); @@ -242,15 +275,15 @@ bool CIRCDDBGatewayAppD::createThread() m_thread->setGateway(gatewayType, gatewayCallsign, gatewayAddress); - wxString aprsHostname; + wxString aprsAddress; unsigned int aprsPort; bool aprsEnabled; - config.getDPRS(aprsEnabled, aprsHostname, aprsPort); - wxLogInfo(wxT("APRS enabled: %d, host: %s:%u"), int(aprsEnabled), aprsHostname.c_str(), aprsPort); + config.getDPRS(aprsEnabled, aprsAddress, aprsPort); + wxLogInfo(wxT("APRS enabled: %d, host: %s:%u"), int(aprsEnabled), aprsAddress.c_str(), aprsPort); CAPRSWriter* aprs = NULL; - if (aprsEnabled && !gatewayCallsign.IsEmpty() && !aprsHostname.IsEmpty() && aprsPort != 0U) { - aprs = new CAPRSWriter(aprsHostname, aprsPort, gatewayCallsign, gatewayAddress); + if (aprsEnabled && !aprsAddress.IsEmpty() && aprsPort != 0U) { + aprs = new CAPRSWriter(aprsAddress, aprsPort, gatewayCallsign); bool res = aprs->open(); if (!res) @@ -264,6 +297,11 @@ bool CIRCDDBGatewayAppD::createThread() config.getMiscellaneous(language, infoEnabled, echoEnabled, logEnabled, dratsEnabled, dtmfEnabled); wxLogInfo(wxT("Language: %d, info enabled: %d, echo enabled: %d, log enabled : %d, D-RATS enabled: %d, DTMF control enabled: %d"), int(language), int(infoEnabled), int(echoEnabled), int(logEnabled), int(dratsEnabled), int(dtmfEnabled)); + bool gpsdEnabled; + wxString gpsdAddress, gpsdPort; + config.getGPSD(gpsdEnabled, gpsdAddress, gpsdPort); + wxLogInfo(wxT("GPSD: %d, address: %s, port: %s"), int(gpsdEnabled), gpsdAddress.c_str(), gpsdPort.c_str()); + CIcomRepeaterProtocolHandler* icomRepeaterHandler = NULL; CHBRepeaterProtocolHandler* hbRepeaterHandler = NULL; CDummyRepeaterProtocolHandler* dummyRepeaterHandler = NULL; @@ -339,15 +377,23 @@ bool CIRCDDBGatewayAppD::createThread() wxLogInfo(wxT("Repeater 1 bands: %u %u %u"), band11, band12, band13); m_thread->addRepeater(callsign1, repeaterBand1, repeaterAddress1, repeaterPort1, repeaterType1, reflector1, atStartup1, reconnect1, dratsEnabled, frequency1, offset1, range1, latitude1, longitude1, agl1, description11, description12, url1, icomRepeaterHandler, band11, band12, band13); - if (aprs != NULL) - aprs->setPort(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign1, repeaterBand1, frequency1, offset1, range1, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); + } icomCount++; } else if (repeaterType1 == HW_HOMEBREW && hbRepeaterHandler != NULL) { m_thread->addRepeater(callsign1, repeaterBand1, repeaterAddress1, repeaterPort1, repeaterType1, reflector1, atStartup1, reconnect1, dratsEnabled, frequency1, offset1, range1, latitude1, longitude1, agl1, description11, description12, url1, hbRepeaterHandler); - if (aprs != NULL) - aprs->setPort(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign1, repeaterBand1, frequency1, offset1, range1, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign1, repeaterBand1, frequency1, offset1, range1, latitude1, longitude1, agl1); + } } else if (repeaterType1 == HW_DUMMY && dummyRepeaterHandler != NULL) { m_thread->addRepeater(callsign1, repeaterBand1, repeaterAddress1, repeaterPort1, repeaterType1, reflector1, atStartup1, reconnect1, dratsEnabled, frequency1, offset1, range1, latitude1, longitude1, agl1, description11, description12, url1, dummyRepeaterHandler); } @@ -427,15 +473,23 @@ bool CIRCDDBGatewayAppD::createThread() wxLogInfo(wxT("Repeater 2 bands: %u %u %u"), band21, band22, band23); m_thread->addRepeater(callsign2, repeaterBand2, repeaterAddress2, repeaterPort2, repeaterType2, reflector2, atStartup2, reconnect2, dratsEnabled, frequency2, offset2, range2, latitude2, longitude2, agl2, description21, description22, url2, icomRepeaterHandler, band21, band22, band23); - if (aprs != NULL) - aprs->setPort(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl2); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign2, repeaterBand2, frequency2, offset2, range2, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl2); + } icomCount++; } else if (repeaterType2 == HW_HOMEBREW && hbRepeaterHandler != NULL) { m_thread->addRepeater(callsign2, repeaterBand2, repeaterAddress2, repeaterPort2, repeaterType2, reflector2, atStartup2, reconnect2, dratsEnabled, frequency2, offset2, range2, latitude2, longitude2, agl2, description21, description22, url2, hbRepeaterHandler); - if (aprs != NULL) - aprs->setPort(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl2); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign2, repeaterBand2, frequency2, offset2, range2, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign2, repeaterBand2, frequency2, offset2, range2, latitude2, longitude2, agl1); + } } else if (repeaterType2 == HW_DUMMY && dummyRepeaterHandler != NULL) { m_thread->addRepeater(callsign2, repeaterBand2, repeaterAddress2, repeaterPort2, repeaterType2, reflector2, atStartup2, reconnect2, dratsEnabled, frequency2, offset2, range2, latitude2, longitude2, agl2, description21, description22, url2, dummyRepeaterHandler); } @@ -519,15 +573,23 @@ bool CIRCDDBGatewayAppD::createThread() wxLogInfo(wxT("Repeater 3 bands: %u %u %u"), band31, band32, band33); m_thread->addRepeater(callsign3, repeaterBand3, repeaterAddress3, repeaterPort3, repeaterType3, reflector3, atStartup3, reconnect3, dratsEnabled, frequency3, offset3, range3, latitude3, longitude3, agl3, description31, description32, url3, icomRepeaterHandler, band31, band32, band33); - if (aprs != NULL) - aprs->setPort(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign3, repeaterBand3, frequency3, offset3, range3, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); + } icomCount++; } else if (repeaterType3 == HW_HOMEBREW && hbRepeaterHandler != NULL) { m_thread->addRepeater(callsign3, repeaterBand3, repeaterAddress3, repeaterPort3, repeaterType3, reflector3, atStartup3, reconnect3, dratsEnabled, frequency3, offset3, range3, latitude3, longitude3, agl3, description31, description32, url3, hbRepeaterHandler); - if (aprs != NULL) - aprs->setPort(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign3, repeaterBand3, frequency3, offset3, range3, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign3, repeaterBand3, frequency3, offset3, range3, latitude3, longitude3, agl3); + } } else if (repeaterType3 == HW_DUMMY && dummyRepeaterHandler != NULL) { m_thread->addRepeater(callsign3, repeaterBand3, repeaterAddress3, repeaterPort3, repeaterType3, reflector3, atStartup3, reconnect3, dratsEnabled, frequency3, offset3, range3, latitude3, longitude3, agl3, description31, description32, url3, dummyRepeaterHandler); } @@ -615,15 +677,23 @@ bool CIRCDDBGatewayAppD::createThread() wxLogInfo(wxT("Repeater 4 bands: %u %u %u"), band41, band42, band43); m_thread->addRepeater(callsign4, repeaterBand4, repeaterAddress4, repeaterPort4, repeaterType4, reflector4, atStartup4, reconnect4, dratsEnabled, frequency4, offset4, range4, latitude4, longitude4, agl4, description41, description42, url4, icomRepeaterHandler, band41, band42, band43); - if (aprs != NULL) - aprs->setPort(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign4, repeaterBand4, frequency4, offset4, range4, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); + } icomCount++; } else if (repeaterType4 == HW_HOMEBREW && hbRepeaterHandler != NULL) { m_thread->addRepeater(callsign4, repeaterBand4, repeaterAddress4, repeaterPort4, repeaterType4, reflector4, atStartup4, reconnect4, dratsEnabled, frequency4, offset4, range4, latitude4, longitude4, agl4, description41, description42, url4, hbRepeaterHandler); - if (aprs != NULL) - aprs->setPort(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); + if (aprs != NULL) { + if (gpsdEnabled) + aprs->setPortGPSD(callsign4, repeaterBand4, frequency4, offset4, range4, gpsdAddress, gpsdPort); + else + aprs->setPortFixed(callsign4, repeaterBand4, frequency4, offset4, range4, latitude4, longitude4, agl4); + } } else if (repeaterType4 == HW_DUMMY && dummyRepeaterHandler != NULL) { m_thread->addRepeater(callsign4, repeaterBand4, repeaterAddress4, repeaterPort4, repeaterType4, reflector4, atStartup4, reconnect4, dratsEnabled, frequency4, offset4, range4, latitude4, longitude4, agl4, description41, description42, url4, dummyRepeaterHandler); } @@ -638,7 +708,7 @@ bool CIRCDDBGatewayAppD::createThread() wxString ircDDBHostname3, ircDDBUsername3, ircDDBPassword3; wxString ircDDBHostname4, ircDDBUsername4, ircDDBPassword4; - config.getIrcDDB(ircDDBEnabled1, ircDDBHostname1, ircDDBUsername1, ircDDBPassword1); + config.getIrcDDB1(ircDDBEnabled1, ircDDBHostname1, ircDDBUsername1, ircDDBPassword1); wxLogInfo(wxT("ircDDB 1 enabled: %d, host: %s, username: %s"), int(ircDDBEnabled1), ircDDBHostname1.c_str(), ircDDBUsername1.c_str()); config.getIrcDDB2(ircDDBEnabled2, ircDDBHostname2, ircDDBUsername2, ircDDBPassword2); @@ -826,10 +896,9 @@ bool CIRCDDBGatewayAppD::createThread() wxLogInfo(wxT("DCS enabled: %d, CCS enabled: %d, server: %s"), int(dcsEnabled), int(ccsEnabled), ccsHost.c_str()); bool xlxEnabled; - bool xlxOverrideLocal; wxString xlxHostsFileUrl; - config.getXLX(xlxEnabled, xlxOverrideLocal, xlxHostsFileUrl); - wxLogInfo(wxT("XLX enabled: %d, Override Local %d, Hosts file url: %s"), int(xlxEnabled), int(xlxOverrideLocal), xlxHostsFileUrl.c_str()); + config.getXLX(xlxEnabled, xlxHostsFileUrl); + wxLogInfo(wxT("XLX enabled: %d, Hosts file url: %s"), int(xlxEnabled), xlxHostsFileUrl.c_str()); if (repeaterBand1.Len() > 1U || repeaterBand2.Len() > 1U || repeaterBand3.Len() > 1U || repeaterBand4.Len() > 1U) { @@ -898,7 +967,7 @@ bool CIRCDDBGatewayAppD::createThread() m_thread->setDExtra(dextraEnabled, dextraMaxDongles); m_thread->setDCS(dcsEnabled); m_thread->setCCS(ccsEnabled, ccsHost); - m_thread->setXLX(xlxEnabled, xlxOverrideLocal, xlxEnabled ? CXLXHostsFileDownloader::Download(xlxHostsFileUrl): wxString(wxEmptyString)); + m_thread->setXLX(xlxEnabled, xlxEnabled ? CXLXHostsFileDownloader::Download(xlxHostsFileUrl): wxString(wxEmptyString)); m_thread->setInfoEnabled(infoEnabled); m_thread->setEchoEnabled(echoEnabled); m_thread->setDTMFEnabled(dtmfEnabled); diff --git a/ircDDBGateway/IRCDDBGatewayAppD.h b/ircDDBGateway/IRCDDBGatewayAppD.h index bee1aa4..359d975 100644 --- a/ircDDBGateway/IRCDDBGatewayAppD.h +++ b/ircDDBGateway/IRCDDBGatewayAppD.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013 by Jonathan Naylor G4KLX + * Copyright (C) 2010-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 @@ -28,7 +28,7 @@ class CIRCDDBGatewayAppD { public: - CIRCDDBGatewayAppD(bool nolog, const wxString& logDir, const wxString& confDir, const wxString& name); + CIRCDDBGatewayAppD(bool nolog, bool debug, bool foreground, const wxString& logDir, const wxString& confDir, const wxString& name); ~CIRCDDBGatewayAppD(); bool init(); @@ -40,12 +40,15 @@ public: private: wxString m_name; bool m_nolog; + bool m_debug; + bool m_foreground; wxString m_logDir; wxString m_confDir; CIRCDDBGatewayThread* m_thread; wxSingleInstanceChecker* m_checker; bool createThread(); + void initLogging(wxLog *logger); }; #endif diff --git a/ircDDBGateway/IRCDDBGatewayFrame.cpp b/ircDDBGateway/IRCDDBGatewayFrame.cpp index 6569d8c..ce1af9f 100644 --- a/ircDDBGateway/IRCDDBGatewayFrame.cpp +++ b/ircDDBGateway/IRCDDBGatewayFrame.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015,2018 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2020 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 @@ -199,7 +199,7 @@ void CIRCDDBGatewayFrame::onAbout(wxCommandEvent&) wxAboutDialogInfo info; info.AddDeveloper(wxT("Jonathan Naylor, G4KLX")); info.AddDeveloper(wxT("Michael Dirska, DL1BFF")); - info.SetCopyright(wxT("(C) 2010-2018 using GPL v2 or later")); + info.SetCopyright(wxT("(C) 2010-2020 using GPL v2 or later")); info.SetName(APPLICATION_NAME); info.SetVersion(VERSION); info.SetDescription(_("This program allows a computer running homebrew repeaters\nto access the ircDDB network for G2 callsign and repeater routing,\nas well as D-Plus and DExtra reflectors. It includes a StarNet\nDigital server.")); @@ -271,14 +271,10 @@ void CIRCDDBGatewayFrame::onTimer(wxTimerEvent&) } bool dprsStatus = status->getDPRSStatus(); - if (dprsStatus) { - if (ircDDBStatus == IS_CONNECTED || ircDDBStatus == IS_DISABLED) - m_dprsStatus->SetLabel(_("Active")); - else - m_dprsStatus->SetLabel(_("Waiting")); - } else { + if (dprsStatus) + m_dprsStatus->SetLabel(_("Active")); + else m_dprsStatus->SetLabel(_("Inactive")); - } for (unsigned int i = 0U; i < 4U; i++) { wxString callsign = status->getCallsign(i); diff --git a/ircDDBGateway/IRCDDBGatewayThread.cpp b/ircDDBGateway/IRCDDBGatewayThread.cpp index 9b9f830..ef6faf0 100644 --- a/ircDDBGateway/IRCDDBGatewayThread.cpp +++ b/ircDDBGateway/IRCDDBGatewayThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2020 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 @@ -72,6 +72,9 @@ m_dextraPool(NULL), m_dplusPool(NULL), m_dcsPool(NULL), m_g2Handler(NULL), +#if defined(ENABLE_NAT_TRAVERSAL) +m_natTraversal(NULL), +#endif m_aprsWriter(NULL), m_irc(NULL), m_cache(), @@ -217,6 +220,13 @@ void CIRCDDBGatewayThread::run() m_g2Handler = NULL; } +#if defined(ENABLE_NAT_TRAVERSAL) + if(m_g2Handler != NULL) { + m_natTraversal = new CNatTraversalHandler(); + m_natTraversal->setG2Handler(m_g2Handler); + } +#endif + // Wait here until we have the essentials to run while (!m_killed && (m_dextraPool == NULL || m_dplusPool == NULL || m_dcsPool == NULL || m_g2Handler == NULL || (m_icomRepeaterHandler == NULL && m_hbRepeaterHandler == NULL && m_dummyRepeaterHandler == NULL) || m_gatewayCallsign.IsEmpty())) ::wxMilliSleep(500UL); // 1/2 sec @@ -318,10 +328,6 @@ void CIRCDDBGatewayThread::run() CCCSHandler::setHeaderLogger(headerLogger); CCCSHandler::setHost(m_ccsHost); - // If no ircDDB then APRS is started immediately - if (m_aprsWriter != NULL && m_irc == NULL) - m_aprsWriter->setEnabled(true); - if (m_remoteEnabled && !m_remotePassword.IsEmpty() && m_remotePort > 0U) { m_remote = new CRemoteHandler(m_remotePassword, m_remotePort, m_gatewayAddress); bool res = m_remote->open(); @@ -409,6 +415,7 @@ void CIRCDDBGatewayThread::run() } } + wxLog::FlushActive(); ::wxMilliSleep(TIME_PER_TIC_MS); } } @@ -576,11 +583,10 @@ void CIRCDDBGatewayThread::setDCS(bool enabled) m_dcsEnabled = enabled; } -void CIRCDDBGatewayThread::setXLX(bool enabled, bool overrideLocal, const wxString& xlxHostsFileName) +void CIRCDDBGatewayThread::setXLX(bool enabled, const wxString& xlxHostsFileName) { m_xlxEnabled = enabled; m_xlxHostsFileName = xlxHostsFileName; - m_xlxOverrideLocal = overrideLocal; } void CIRCDDBGatewayThread::setCCS(bool enabled, const wxString& host) @@ -689,24 +695,18 @@ void CIRCDDBGatewayThread::processIrcDDB() if (m_lastStatus != IS_DISCONNECTED) { wxLogInfo(wxT("Disconnected from ircDDB")); m_lastStatus = IS_DISCONNECTED; - if (m_aprsWriter != NULL) - m_aprsWriter->setEnabled(false); } break; case 7: if (m_lastStatus != IS_CONNECTED) { wxLogInfo(wxT("Connected to ircDDB")); m_lastStatus = IS_CONNECTED; - if (m_aprsWriter != NULL) - m_aprsWriter->setEnabled(true); } break; default: if (m_lastStatus != IS_CONNECTING) { wxLogInfo(wxT("Connecting to ircDDB")); m_lastStatus = IS_CONNECTING; - if (m_aprsWriter != NULL) - m_aprsWriter->setEnabled(false); } break; } @@ -728,6 +728,9 @@ void CIRCDDBGatewayThread::processIrcDDB() if (!address.IsEmpty()) { wxLogMessage(wxT("USER: %s %s %s %s"), user.c_str(), repeater.c_str(), gateway.c_str(), address.c_str()); m_cache.updateUser(user, repeater, gateway, address, timestamp, DP_DEXTRA, false, false); +#if defined(ENABLE_NAT_TRAVERSAL) + m_natTraversal->traverseNatG2(address); +#endif } else { wxLogMessage(wxT("USER: %s NOT FOUND"), user.c_str()); } @@ -744,6 +747,9 @@ void CIRCDDBGatewayThread::processIrcDDB() if (!address.IsEmpty()) { wxLogMessage(wxT("REPEATER: %s %s %s"), repeater.c_str(), gateway.c_str(), address.c_str()); m_cache.updateRepeater(repeater, gateway, address, DP_DEXTRA, false, false); +#if defined(ENABLE_NAT_TRAVERSAL) + m_natTraversal->traverseNatG2(address); +#endif } else { wxLogMessage(wxT("REPEATER: %s NOT FOUND"), repeater.c_str()); } @@ -761,6 +767,9 @@ void CIRCDDBGatewayThread::processIrcDDB() if (!address.IsEmpty()) { wxLogMessage(wxT("GATEWAY: %s %s"), gateway.c_str(), address.c_str()); m_cache.updateGateway(gateway, address, DP_DEXTRA, false, false); +#if defined(ENABLE_NAT_TRAVERSAL) + m_natTraversal->traverseNatG2(address); +#endif } else { wxLogMessage(wxT("GATEWAY: %s NOT FOUND"), gateway.c_str()); } @@ -1108,9 +1117,8 @@ void CIRCDDBGatewayThread::loadGateways() void CIRCDDBGatewayThread::loadReflectors() { - if(m_xlxEnabled && !m_xlxOverrideLocal) { + if (m_xlxEnabled) loadXLXReflectors(); - } if (m_dplusEnabled) { wxFileName fileName(wxFileName::GetHomeDir(), DPLUS_HOSTS_FILE_NAME); @@ -1153,10 +1161,6 @@ void CIRCDDBGatewayThread::loadReflectors() if (fileName.IsFileReadable()) loadDCSReflectors(fileName.GetFullPath()); } - - if(m_xlxEnabled && m_xlxOverrideLocal) { - loadXLXReflectors(); - } } void CIRCDDBGatewayThread::loadDExtraReflectors(const wxString& fileName) @@ -1258,6 +1262,10 @@ void CIRCDDBGatewayThread::loadXLXReflectors() CHostFile hostFile = CHostFile(m_xlxHostsFileName, true); for (unsigned int i = 0U; i < hostFile.getCount(); i++) { wxString reflector = hostFile.getName(i); + + if (!reflector.StartsWith(wxT("XLX"))) + continue; + in_addr address = CUDPReaderWriter::lookup(hostFile.getAddress(i)); bool lock = hostFile.getLock(i); @@ -1274,10 +1282,10 @@ void CIRCDDBGatewayThread::loadXLXReflectors() reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U); reflector.Append(wxT("G")); - if(m_dcsEnabled && reflector.StartsWith(wxT("DCS"))) + //if (m_dcsEnabled && reflector.StartsWith(wxT("DCS"))) m_cache.updateGateway(reflector, addrText, DP_DCS, lock, true); - else if(m_dextraEnabled && reflector.StartsWith(wxT("XRF"))) - m_cache.updateGateway(reflector, addrText, DP_DEXTRA, lock, true); + //else if (m_dextraEnabled && reflector.StartsWith(wxT("XRF"))) + // m_cache.updateGateway(reflector, addrText, DP_DEXTRA, lock, true); count++; } @@ -1316,7 +1324,7 @@ CIRCDDBGatewayStatusData* CIRCDDBGatewayThread::getStatus() const { bool aprsStatus = false; if (m_aprsWriter != NULL) - aprsStatus = m_aprsWriter->isConnected(); + aprsStatus = true; CIRCDDBGatewayStatusData* status = new CIRCDDBGatewayStatusData(m_lastStatus, aprsStatus); diff --git a/ircDDBGateway/IRCDDBGatewayThread.h b/ircDDBGateway/IRCDDBGatewayThread.h index e3cc863..f89361b 100644 --- a/ircDDBGateway/IRCDDBGatewayThread.h +++ b/ircDDBGateway/IRCDDBGatewayThread.h @@ -35,6 +35,9 @@ #include "IRCDDB.h" #include "Timer.h" #include "Defs.h" +#if defined(ENABLE_NAT_TRAVERSAL) +#include "NatTraversalHandler.h" +#endif #include @@ -58,7 +61,7 @@ public: virtual void setDExtra(bool enabled, unsigned int maxDongles); virtual void setDPlus(bool enabled, unsigned int maxDongles, const wxString& login); virtual void setDCS(bool enabled); - virtual void setXLX(bool enabled, bool overrideLocal, const wxString& fileName); + virtual void setXLX(bool enabled, const wxString& fileName); virtual void setCCS(bool enabled, const wxString& host); virtual void setLog(bool enabled); virtual void setAPRSWriter(CAPRSWriter* writer); @@ -92,6 +95,9 @@ private: CDPlusProtocolHandlerPool* m_dplusPool; CDCSProtocolHandlerPool* m_dcsPool; CG2ProtocolHandler* m_g2Handler; +#if defined(ENABLE_NAT_TRAVERSAL) + CNatTraversalHandler* m_natTraversal; +#endif CAPRSWriter* m_aprsWriter; CIRCDDB* m_irc; CCacheManager m_cache; @@ -103,7 +109,6 @@ private: wxString m_dplusLogin; bool m_dcsEnabled; bool m_xlxEnabled; - bool m_xlxOverrideLocal; wxString m_xlxHostsFileName; bool m_ccsEnabled; wxString m_ccsHost; diff --git a/ircDDBGateway/Makefile b/ircDDBGateway/Makefile index 3bf974e..6118f46 100644 --- a/ircDDBGateway/Makefile +++ b/ircDDBGateway/Makefile @@ -1,16 +1,29 @@ OBJECTS = IRCDDBGatewayAppD.o IRCDDBGatewayStatusData.o IRCDDBGatewayThread.o IRCDDBGatewayThreadHelper.o +.PHONY: all all: ircddbgatewayd -ircddbgatewayd: $(OBJECTS) +ircddbgatewayd: $(OBJECTS) ../ircDDB/IRCDDB.a ../Common/Common.a $(CXX) $(OBJECTS) ../Common/Common.a ../ircDDB/IRCDDB.a $(LDFLAGS) $(LIBS) -o ircddbgatewayd +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../Common -I../ircDDB -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common -I../ircDDB $< > $*.d +.PHONY: install install: - install -g bin -o root -m 0775 ircddbgatewayd $(BINDIR) + install -g root -o root -m 0755 ircddbgatewayd $(DESTDIR)$(BINDIR) + cp ircddbgateway-emptyconfig $(DESTDIR)$(CONFDIR)/ircddbgateway +ifeq ($(TARGET), opendv) + cp ../debian/ircddbgatewayd.ircddbgatewayd.service $(DESTDIR)/etc/systemd/system/ircddbgatewayd.service +endif +.PHONY: clean clean: $(RM) ircddbgatewayd *.o *.d *.bak *~ +../Common/Common.a: +../ircDDB/IRCDDB.a: + diff --git a/ircDDBGateway/MakefileGUI b/ircDDBGateway/MakefileGUI new file mode 100644 index 0000000..f9e2bb5 --- /dev/null +++ b/ircDDBGateway/MakefileGUI @@ -0,0 +1,26 @@ +OBJECTS = IRCDDBGatewayApp.o IRCDDBGatewayFrame.o IRCDDBGatewayLogRedirect.o IRCDDBGatewayStatusData.o IRCDDBGatewayThread.o \ + IRCDDBGatewayThreadHelper.o + +.PHONY: all +all: ircddbgateway + +ircddbgateway: $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a + $(CXX) $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a ../ircDDB/IRCDDB.a $(LDFLAGS) $(GUILIBS) -o ircddbgateway + +-include $(OBJECTS:.o=.d) + +%.o: %.cpp + $(CXX) $(CFLAGS) -I../Common -I../GUICommon -I../ircDDB -c -o $@ $< + $(CXX) -MM $(CFLAGS) -I../Common -I../GUICommon -I../ircDDB $< > $*.d + +.PHONY: install +install: + install -g bin -o root -m 0775 ircddbgateway $(BINDIR) + +.PHONY: clean +clean: + $(RM) ircddbgateway *.o *.d *.bak *~ + +../GUICommon/GUICommon.a: +../Common/Common.a: + diff --git a/ircDDBGateway/ircDDBGateway.vcxproj b/ircDDBGateway/ircDDBGateway.vcxproj index 991b1d1..5b8ae21 100644 --- a/ircDDBGateway/ircDDBGateway.vcxproj +++ b/ircDDBGateway/ircDDBGateway.vcxproj @@ -22,29 +22,29 @@ {6DDA3497-66A3-4856-BAD4-1DDCDBDFF959} ircDDBGateway Win32Proj - 10.0.16299.0 + 10.0 Application - v141 + v142 Unicode true Application - v141 + v142 Unicode true Application - v141 + v142 Unicode Application - v141 + v142 Unicode @@ -80,9 +80,11 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ false + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) false + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath) diff --git a/ircDDBGateway/ircddbgateway-emptyconfig b/ircDDBGateway/ircddbgateway-emptyconfig new file mode 100644 index 0000000..1a79b95 --- /dev/null +++ b/ircDDBGateway/ircddbgateway-emptyconfig @@ -0,0 +1,183 @@ +gatewayType=0 +gatewayCallsign= +gatewayAddress=0.0.0.0 +icomAddress=172.16.0.20 +icomPort=20000 +hbAddress=127.0.0.1 +hbPort=20010 +latitude= +longitude= +description1= +description2= +url= +repeaterCall1= +repeaterBand1=B +repeaterType1=0 +repeaterAddress1=127.0.0.1 +repeaterPort1=20011 +reflector1= +atStartup1=0 +reconnect1=0 +frequency1=434.00000 +offset1=0.0000 +rangeKms1=0.000 +latitude1=0.000000 +longitude1=0.000000 +agl1=0.000 +description1_1= +description1_2= +url1= +band1_1=0 +band1_2=0 +band1_3=0 +repeaterCall2= +repeaterBand2= +repeaterType2=0 +repeaterAddress2=127.0.0.1 +repeaterPort2=20012 +reflector2= +atStartup2=0 +reconnect2=0 +frequency2=0.00000 +offset2=0.0000 +rangeKms2=0.000 +latitude2=0.000000 +longitude2=0.000000 +agl2=0.000 +description2_1= +description2_2= +url2= +band2_1=0 +band2_2=0 +band2_3=0 +repeaterCall3= +repeaterBand3= +repeaterType3=0 +repeaterAddress3=127.0.0.1 +repeaterPort3=20013 +reflector3= +atStartup3=0 +reconnect3=0 +frequency3=0.00000 +offset3=0.0000 +rangeKms3=0.000 +latitude3=0.000000 +longitude3=0.000000 +agl3=0.000 +description3_1= +description3_2= +url3= +band3_1=0 +band3_2=0 +band3_3=0 +repeaterCall4= +repeaterBand4= +repeaterType4=0 +repeaterAddress4=127.0.0.1 +repeaterPort4=20014 +reflector4= +atStartup4=0 +reconnect4=0 +frequency4=0.00000 +offset4=0.0000 +rangeKms4=0.000 +latitude4=0.000000 +longitude4=0.000000 +agl4=0.000 +description4_1= +description4_2= +url4= +band4_1=0 +band4_2=0 +band4_3=0 +ircddbEnabled=1 +ircddbHostname=rr.openquad.net +ircddbUsername= +ircddbPassword= +ircddbEnabled2=0 +ircddbHostname2=rr.openquad.net +ircddbUsername2= +ircddbPassword2= +ircddbEnabled3=0 +ircddbHostname3= +ircddbUsername3= +ircddbPassword3= +ircddbEnabled4=0 +ircddbHostname4= +ircddbUsername4= +ircddbPassword4= +aprsEnabled=1 +aprsHostname=rotate.aprs2.net +aprsPassword= +aprsPort=14580 +dextraEnabled=1 +dextraMaxDongles=5 +dplusEnabled=0 +dplusMaxDongles=5 +dplusLogin= +dcsEnabled=1 +ccsEnabled=1 +ccsHost=CCS704 +xlxEnabled=1 +xlxHostsFileUrl=http://xlxapi.rlx.lu/api.php?do=GetReflectorHostname +starNetBand1=A +starNetCallsign1= +starNetLogoff1= +starNetInfo1= +starNetPermanent1= +starNetUserTimeout1=300 +starNetGroupTimeout1=300 +starNetCallsignSwitch1=0 +starNetTXMsgSwitch1=1 +starNetReflector1= +starNetBand2=A +starNetCallsign2= +starNetLogoff2= +starNetInfo2= +starNetPermanent2= +starNetUserTimeout2=300 +starNetGroupTimeout2=300 +starNetCallsignSwitch2=0 +starNetTXMsgSwitch2=1 +starNetReflector2= +starNetBand3=A +starNetCallsign3= +starNetLogoff3= +starNetInfo3= +starNetPermanent3= +starNetUserTimeout3=300 +starNetGroupTimeout3=300 +starNetCallsignSwitch3=0 +starNetTXMsgSwitch3=1 +starNetReflector3= +starNetBand4=A +starNetCallsign4= +starNetLogoff4= +starNetInfo4= +starNetPermanent4= +starNetUserTimeout4=300 +starNetGroupTimeout4=300 +starNetCallsignSwitch4=0 +starNetTXMsgSwitch4=1 +starNetReflector4= +starNetBand5=A +starNetCallsign5= +starNetLogoff5= +starNetInfo5= +starNetPermanent5= +starNetUserTimeout5=300 +starNetGroupTimeout5=300 +starNetCallsignSwitch5=0 +starNetTXMsgSwitch5=1 +starNetReflector5= +remoteEnabled=1 +remotePassword= +remotePort=54321 +language=0 +infoEnabled=1 +echoEnabled=1 +logEnabled=0 +dratsEnabled=0 +dtmfEnabled=1 +windowX=-1 +windowY=-1 diff --git a/ircDDBGateway32.nsi b/ircDDBGateway32.nsi new file mode 100644 index 0000000..6300ec4 --- /dev/null +++ b/ircDDBGateway32.nsi @@ -0,0 +1,131 @@ +;NSIS Modern User Interface +;Repeater install script +;Written by Jonathan Naylor + +;-------------------------------- +;Include Modern UI + + !include "MUI2.nsh" + +;-------------------------------- +;Configuration + + ;General + Name "ircDDB Gateway 20180719" + OutFile "ircDDBGateway32-20180719.exe" + + ;Folder selection page + InstallDir "$PROGRAMFILES\ircDDBGateway" + + ;Request application privileges for Windows Vista + RequestExecutionLevel admin + +;-------------------------------- +;Interface Settings + + !define MUI_ABORTWARNING + +;-------------------------------- +;Pages + + !insertmacro MUI_PAGE_LICENSE "COPYING.txt" + !insertmacro MUI_PAGE_DIRECTORY + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +;Installer Sections + +Section "Repeater Program Files" SecProgram + + SetOutPath "$INSTDIR" + + File "Release\ircDDBGateway.exe" + File "Release\ircDDBGatewayConfig.exe" + File "Release\RemoteControl.exe" + File "Release\StarNetServer.exe" + File "Release\TextTransmit.exe" + File "Release\TimerControl.exe" + File "Release\TimeServer.exe" + File "Release\VoiceTransmit.exe" + File "C:\wxWidgets-3.0.4\lib\vc_dll\wxbase30u_vc_custom.dll" + File "C:\wxWidgets-3.0.4\lib\vc_dll\wxmsw30u_adv_vc_custom.dll" + File "C:\wxWidgets-3.0.4\lib\vc_dll\wxmsw30u_core_vc_custom.dll" + File "CHANGES.txt" + File "COPYING.txt" + File "Data\CCS_Hosts.txt" + File "Data\DCS_Hosts.txt" + File "Data\DExtra_Hosts.txt" + File "Data\DPlus_Hosts.txt" + File "Data\TIME_de_DE.ambe" + File "Data\TIME_de_DE.indx" + File "Data\TIME_en_GB.ambe" + File "Data\TIME_en_GB.indx" + File "Data\TIME_en_US.ambe" + File "Data\TIME_en_US.indx" + File "Data\TIME_fr_FR.ambe" + File "Data\TIME_fr_FR.indx" + File "Data\TIME_se_SE.ambe" + File "Data\TIME_se_SE.indx" + File "Data\de_DE.ambe" + File "Data\de_DE.indx" + File "Data\dk_DK.ambe" + File "Data\dk_DK.indx" + File "Data\en_GB.ambe" + File "Data\en_GB.indx" + File "Data\en_US.ambe" + File "Data\en_US.indx" + File "Data\es_ES.ambe" + File "Data\es_ES.indx" + File "Data\fr_FR.ambe" + File "Data\fr_FR.indx" + File "Data\it_IT.ambe" + File "Data\it_IT.indx" + File "Data\no_NO.ambe" + File "Data\no_NO.indx" + File "Data\pl_PL.ambe" + File "Data\pl_PL.indx" + File "Data\se_SE.ambe" + File "Data\se_SE.indx" + + ;Create start menu entry + CreateDirectory "$SMPROGRAMS\ircDDBGateway" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\ircDDB Gateway.lnk" "$INSTDIR\ircDDBGateway.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\ircDDB Gateway Config.lnk" "$INSTDIR\ircDDBGatewayConfig.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Remote Control.lnk" "$INSTDIR\RemoteControl.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\StarNet Server.lnk" "$INSTDIR\StarNetServer.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Timer Control.lnk" "$INSTDIR\TimerControl.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Time Server.lnk" "$INSTDIR\TimeServer.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Changes.lnk" "$INSTDIR\CHANGES.txt" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Licence.lnk" "$INSTDIR\COPYING.txt" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + +SectionEnd + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + + Delete "$INSTDIR\*.*" + RMDir "$INSTDIR" + + Delete "$SMPROGRAMS\ircDDBGateway\*.*" + RMDir "$SMPROGRAMS\ircDDBGateway" + + DeleteRegKey /ifempty HKCU "Software\G4KLX\IRCDDB Gateway" + DeleteRegKey /ifempty HKCU "Software\G4KLX\Remote Control" + DeleteRegKey /ifempty HKCU "Software\G4KLX\StarNet Server" + DeleteRegKey /ifempty HKCU "Software\G4KLX\Timer Control" + DeleteRegKey /ifempty HKCU "Software\G4KLX\Time Server" + +SectionEnd diff --git a/ircDDBGateway64.nsi b/ircDDBGateway64.nsi new file mode 100644 index 0000000..fb1b779 --- /dev/null +++ b/ircDDBGateway64.nsi @@ -0,0 +1,131 @@ +;NSIS Modern User Interface +;Repeater install script +;Written by Jonathan Naylor + +;-------------------------------- +;Include Modern UI + + !include "MUI2.nsh" + +;-------------------------------- +;Configuration + + ;General + Name "ircDDB Gateway 20180719" + OutFile "ircDDBGateway64-20180719.exe" + + ;Folder selection page + InstallDir "$PROGRAMFILES64\ircDDBGateway" + + ;Request application privileges for Windows Vista + RequestExecutionLevel admin + +;-------------------------------- +;Interface Settings + + !define MUI_ABORTWARNING + +;-------------------------------- +;Pages + + !insertmacro MUI_PAGE_LICENSE "COPYING.txt" + !insertmacro MUI_PAGE_DIRECTORY + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +;Installer Sections + +Section "Repeater Program Files" SecProgram + + SetOutPath "$INSTDIR" + + File "x64\Release\ircDDBGateway.exe" + File "x64\Release\ircDDBGatewayConfig.exe" + File "x64\Release\RemoteControl.exe" + File "x64\Release\StarNetServer.exe" + File "x64\Release\TextTransmit.exe" + File "x64\Release\TimerControl.exe" + File "x64\Release\TimeServer.exe" + File "x64\Release\VoiceTransmit.exe" + File "C:\wxWidgets-3.0.4\lib\vc_x64_dll\wxbase30u_vc_x64_custom.dll" + File "C:\wxWidgets-3.0.4\lib\vc_x64_dll\wxmsw30u_adv_vc_x64_custom.dll" + File "C:\wxWidgets-3.0.4\lib\vc_x64_dll\wxmsw30u_core_vc_x64_custom.dll" + File "CHANGES.txt" + File "COPYING.txt" + File "Data\CCS_Hosts.txt" + File "Data\DCS_Hosts.txt" + File "Data\DExtra_Hosts.txt" + File "Data\DPlus_Hosts.txt" + File "Data\TIME_de_DE.ambe" + File "Data\TIME_de_DE.indx" + File "Data\TIME_en_GB.ambe" + File "Data\TIME_en_GB.indx" + File "Data\TIME_en_US.ambe" + File "Data\TIME_en_US.indx" + File "Data\TIME_fr_FR.ambe" + File "Data\TIME_fr_FR.indx" + File "Data\TIME_se_SE.ambe" + File "Data\TIME_se_SE.indx" + File "Data\de_DE.ambe" + File "Data\de_DE.indx" + File "Data\dk_DK.ambe" + File "Data\dk_DK.indx" + File "Data\en_GB.ambe" + File "Data\en_GB.indx" + File "Data\en_US.ambe" + File "Data\en_US.indx" + File "Data\es_ES.ambe" + File "Data\es_ES.indx" + File "Data\fr_FR.ambe" + File "Data\fr_FR.indx" + File "Data\it_IT.ambe" + File "Data\it_IT.indx" + File "Data\no_NO.ambe" + File "Data\no_NO.indx" + File "Data\pl_PL.ambe" + File "Data\pl_PL.indx" + File "Data\se_SE.ambe" + File "Data\se_SE.indx" + + ;Create start menu entry + CreateDirectory "$SMPROGRAMS\ircDDBGateway" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\ircDDB Gateway.lnk" "$INSTDIR\ircDDBGateway.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\ircDDB Gateway Config.lnk" "$INSTDIR\ircDDBGatewayConfig.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Remote Control.lnk" "$INSTDIR\RemoteControl.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\StarNet Server.lnk" "$INSTDIR\StarNetServer.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Timer Control.lnk" "$INSTDIR\TimerControl.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Time Server.lnk" "$INSTDIR\TimeServer.exe" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Changes.lnk" "$INSTDIR\CHANGES.txt" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Licence.lnk" "$INSTDIR\COPYING.txt" + CreateShortCut "$SMPROGRAMS\ircDDBGateway\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + +SectionEnd + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + + Delete "$INSTDIR\*.*" + RMDir "$INSTDIR" + + Delete "$SMPROGRAMS\ircDDBGateway\*.*" + RMDir "$SMPROGRAMS\ircDDBGateway" + + DeleteRegKey /ifempty HKCU "Software\G4KLX\IRCDDB Gateway" + DeleteRegKey /ifempty HKCU "Software\G4KLX\Remote Control" + DeleteRegKey /ifempty HKCU "Software\G4KLX\StarNet Server" + DeleteRegKey /ifempty HKCU "Software\G4KLX\Timer Control" + DeleteRegKey /ifempty HKCU "Software\G4KLX\Time Server" + +SectionEnd diff --git a/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.cpp b/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.cpp index 1710617..2e11c32 100644 --- a/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.cpp +++ b/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015,2018 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2015,2018,2020 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 @@ -65,6 +65,7 @@ m_starNet3(NULL), m_starNet4(NULL), m_starNet5(NULL), m_remote(NULL), +m_gpsd(NULL), m_miscellaneous(NULL) { SetMenuBar(createMenuBar()); @@ -103,9 +104,8 @@ m_miscellaneous(NULL) m_config->getDCS(dcsEnabled, ccsEnabled, ccsHost); bool xlxEnabled; - bool xlxOverrideLocal; wxString xlxHostsFileUrl; - m_config->getXLX(xlxEnabled, xlxOverrideLocal, xlxHostsFileUrl); + m_config->getXLX(xlxEnabled, xlxHostsFileUrl); GATEWAY_TYPE gatewayType; wxString gatewayCallsign, gatewayAddress, icomAddress, hbAddress, description1, description2, url; @@ -178,7 +178,7 @@ m_miscellaneous(NULL) bool ircDDBEnabled; wxString ircDDBHostname, ircDDBUsername, ircDDBPassword; - m_config->getIrcDDB(ircDDBEnabled, ircDDBHostname, ircDDBUsername, ircDDBPassword); + m_config->getIrcDDB1(ircDDBEnabled, ircDDBHostname, ircDDBUsername, ircDDBPassword); m_ircDDB = new CIRCDDBGatewayConfigIrcDDBSet(noteBook, -1, APPLICATION_NAME, ircDDBEnabled, ircDDBHostname, ircDDBUsername, ircDDBPassword); noteBook->AddPage(m_ircDDB, wxT("ircDDB 1st Network"), false); @@ -194,12 +194,12 @@ m_miscellaneous(NULL) m_ircDDB4 = new CIRCDDBGatewayConfigIrcDDBSet(noteBook, -1, APPLICATION_NAME, ircDDBEnabled, ircDDBHostname, ircDDBUsername, ircDDBPassword); noteBook->AddPage(m_ircDDB4, wxT("ircDDB 4th Network"), false); - wxString aprsHostname; + wxString aprsAddress; unsigned int aprsPort; bool aprsEnabled; - m_config->getDPRS(aprsEnabled, aprsHostname, aprsPort); + m_config->getDPRS(aprsEnabled, aprsAddress, aprsPort); - m_dprs = new CDPRSSet(noteBook, -1, APPLICATION_NAME, aprsEnabled, aprsHostname, aprsPort); + m_dprs = new CDPRSSet(noteBook, -1, APPLICATION_NAME, aprsEnabled, aprsAddress, aprsPort); noteBook->AddPage(m_dprs, wxT("D-PRS"), false); m_dextra = new CDExtraSet(noteBook, -1, APPLICATION_NAME, dextraEnabled, maxDExtraDongles, MAX_DEXTRA_LINKS); @@ -211,7 +211,7 @@ m_miscellaneous(NULL) m_dcs = new CDCSSet(noteBook, -1, APPLICATION_NAME, dcsEnabled, ccsEnabled, ccsHost); noteBook->AddPage(m_dcs, _("DCS and CCS"), false); - m_xlx = new CXLXSet(noteBook, -1, APPLICATION_NAME, xlxEnabled, xlxOverrideLocal, xlxHostsFileUrl); + m_xlx = new CXLXSet(noteBook, -1, APPLICATION_NAME, xlxEnabled, xlxHostsFileUrl); noteBook->AddPage(m_xlx, _("XLX Hosts File"), false); #if defined(DEXTRA_LINK) || defined(DCS_LINK) @@ -314,6 +314,13 @@ m_miscellaneous(NULL) m_remote = new CRemoteSet(noteBook, -1, APPLICATION_NAME, remoteEnabled, remotePassword, remotePort); noteBook->AddPage(m_remote, wxT("Remote"), false); + bool gpsdEnabled; + wxString gpsdAddress, gpsdPort; + m_config->getGPSD(gpsdEnabled, gpsdAddress, gpsdPort); + + m_gpsd = new CGPSDSet(noteBook, -1, APPLICATION_NAME, gpsdEnabled, gpsdAddress, gpsdPort); + noteBook->AddPage(m_gpsd, wxT("GPSD"), false); + TEXT_LANG language; bool infoEnabled, echoEnabled, logEnabled, dratsEnabled, dtmfEnabled; m_config->getMiscellaneous(language, infoEnabled, echoEnabled, logEnabled, dratsEnabled, dtmfEnabled); @@ -321,15 +328,15 @@ m_miscellaneous(NULL) m_miscellaneous = new CIRCDDBGatewayConfigMiscellaneousSet(noteBook, -1, APPLICATION_NAME, language, infoEnabled, echoEnabled, logEnabled, dratsEnabled, dtmfEnabled); noteBook->AddPage(m_miscellaneous, wxT("Misc"), false); - sizer->Add(noteBook, 0, wxEXPAND | wxALL, BORDER_SIZE); + sizer->Add(noteBook, 0, wxEXPAND | wxALL, BORDER_SIZE); - panel->SetSizer(sizer); + panel->SetSizer(sizer); - mainSizer->Add(panel, 0, wxEXPAND | wxALL, BORDER_SIZE); + mainSizer->Add(panel, 0, wxEXPAND | wxALL, BORDER_SIZE); - mainSizer->SetSizeHints(this); + mainSizer->SetSizeHints(this); - SetSizer(mainSizer); + SetSizer(mainSizer); } CIRCDDBGatewayConfigFrame::~CIRCDDBGatewayConfigFrame() @@ -371,7 +378,7 @@ void CIRCDDBGatewayConfigFrame::onSave(wxCommandEvent&) !m_repeaterInfo4->Validate() || !m_ircDDB->Validate() || !m_ircDDB2->Validate() || !m_ircDDB3->Validate() || !m_ircDDB4->Validate() || !m_dprs->Validate() || !m_dplus->Validate() || !m_dcs->Validate() || !m_xlx->Validate() || !m_starNet1->Validate() || !m_starNet2->Validate() || !m_starNet3->Validate() || !m_starNet4->Validate() || - !m_starNet5->Validate() || !m_remote->Validate() || !m_miscellaneous->Validate()) + !m_starNet5->Validate() || !m_remote->Validate() || !m_gpsd->Validate() || !m_miscellaneous->Validate()) return; GATEWAY_TYPE gatewayType = m_gateway->getType(); @@ -476,7 +483,7 @@ void CIRCDDBGatewayConfigFrame::onSave(wxCommandEvent&) wxString ircDDBHostname = m_ircDDB->getHostname(); wxString ircDDBUsername = m_ircDDB->getUsername(); wxString ircDDBPassword = m_ircDDB->getPassword(); - m_config->setIrcDDB(ircDDBEnabled, ircDDBHostname, ircDDBUsername, ircDDBPassword); + m_config->setIrcDDB1(ircDDBEnabled, ircDDBHostname, ircDDBUsername, ircDDBPassword); ircDDBEnabled = m_ircDDB2->getEnabled(); ircDDBHostname = m_ircDDB2->getHostname(); @@ -497,9 +504,9 @@ void CIRCDDBGatewayConfigFrame::onSave(wxCommandEvent&) m_config->setIrcDDB4(ircDDBEnabled, ircDDBHostname, ircDDBUsername, ircDDBPassword); bool aprsEnabled = m_dprs->getEnabled(); - wxString aprsHostname = m_dprs->getHostname(); + wxString aprsAddress = m_dprs->getAddress(); unsigned int aprsPort = m_dprs->getPort(); - m_config->setDPRS(aprsEnabled, aprsHostname, aprsPort); + m_config->setDPRS(aprsEnabled, aprsAddress, aprsPort); bool dextraEnabled = m_dextra->getEnabled(); unsigned int maxDExtraDongles = m_dextra->getMaxDongles(); @@ -516,9 +523,8 @@ void CIRCDDBGatewayConfigFrame::onSave(wxCommandEvent&) m_config->setDCS(dcsEnabled, ccsEnabled, ccsHost); bool xlxEnabled = m_xlx->getXLXEnabled(); - bool xlxOverrideLocal = m_xlx->getXLXOverrideLocal(); wxString xlxHostsFileUrl = m_xlx->getXLXHostsFileUrl(); - m_config->setXLX(xlxEnabled, xlxOverrideLocal, xlxHostsFileUrl); + m_config->setXLX(xlxEnabled, xlxHostsFileUrl); wxString starNetBand1 = m_starNet1->getBand(); wxString starNetCallsign1 = m_starNet1->getCallsign(); @@ -605,6 +611,11 @@ void CIRCDDBGatewayConfigFrame::onSave(wxCommandEvent&) unsigned int remotePort = m_remote->getPort(); m_config->setRemote(remoteEnabled, remotePassword, remotePort); + bool gpsdEnabled = m_gpsd->getEnabled(); + wxString gpsdAddress = m_gpsd->getAddress(); + wxString gpsdPort = m_gpsd->getPort(); + m_config->setGPSD(gpsdEnabled, gpsdAddress, gpsdPort); + TEXT_LANG language = m_miscellaneous->getLanguage(); bool infoEnabled = m_miscellaneous->getInfoEnabled(); bool echoEnabled = m_miscellaneous->getEchoEnabled(); @@ -627,7 +638,7 @@ void CIRCDDBGatewayConfigFrame::onAbout(wxCommandEvent&) { wxAboutDialogInfo info; info.AddDeveloper(wxT("Jonathan Naylor, G4KLX")); - info.SetCopyright(wxT("(C) 2010-2018 using GPL v2 or later")); + info.SetCopyright(wxT("(C) 2010-2020 using GPL v2 or later")); info.SetName(APPLICATION_NAME); info.SetVersion(VERSION); info.SetDescription(_("This program configures the ircDDB Gateway.")); diff --git a/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.h b/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.h index 15032c0..b32d972 100644 --- a/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.h +++ b/ircDDBGatewayConfig/IRCDDBGatewayConfigFrame.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2014,2018,2020 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 @@ -30,6 +30,7 @@ #include "DExtraSet.h" #include "DPlusSet.h" #include "DPRSSet.h" +#include "GPSDSet.h" #include "DCSSet.h" #include "XLXSet.h" #include "Defs.h" @@ -65,13 +66,14 @@ private: CDExtraSet* m_dextra; CDPlusSet* m_dplus; CDCSSet* m_dcs; - CXLXSet* m_xlx; + CXLXSet* m_xlx; CStarNetSet* m_starNet1; CStarNetSet* m_starNet2; CStarNetSet* m_starNet3; CStarNetSet* m_starNet4; CStarNetSet* m_starNet5; CRemoteSet* m_remote; + CGPSDSet* m_gpsd; CIRCDDBGatewayConfigMiscellaneousSet* m_miscellaneous; DECLARE_EVENT_TABLE() diff --git a/ircDDBGatewayConfig/Makefile b/ircDDBGatewayConfig/Makefile index bdc24ef..3bff41c 100644 --- a/ircDDBGatewayConfig/Makefile +++ b/ircDDBGatewayConfig/Makefile @@ -1,17 +1,25 @@ OBJECTS = IRCDDBGatewayConfigApp.o IRCDDBGatewayConfigFrame.o IRCDDBGatewayConfigGatewaySet.o IRCDDBGatewayConfigIrcDDBSet.o \ IRCDDBGatewayConfigMiscellaneousSet.o +.PHONY: all all: ircddbgatewayconfig -ircddbgatewayconfig: $(OBJECTS) +ircddbgatewayconfig: $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a $(CXX) $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a $(LDFLAGS) $(GUILIBS) -o ircddbgatewayconfig +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) $(CFLAGS) -I../Common -I../GUICommon -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common -I../GUICommon $< > $*.d +.PHONY: install install: - install -g bin -o root -m 0775 ircddbgatewayconfig $(BINDIR) + install -g root -o root -m 0755 ircddbgatewayconfig $(DESTDIR)$(BINDIR) +.PHONY: clean clean: $(RM) ircddbgatewayconfig *.o *.d *.bak *~ +../Common/Common.a: +../GUICommon/GUICommon.a: diff --git a/ircDDBGatewayConfig/ircDDBGatewayConfig.vcxproj b/ircDDBGatewayConfig/ircDDBGatewayConfig.vcxproj index 1d6186c..786e575 100644 --- a/ircDDBGatewayConfig/ircDDBGatewayConfig.vcxproj +++ b/ircDDBGatewayConfig/ircDDBGatewayConfig.vcxproj @@ -22,29 +22,29 @@ {D0A32505-822B-4936-A61B-A5151966AEAA} ircDDBGatewayConfig Win32Proj - 10.0.16299.0 + 10.0 Application - v141 + v142 Unicode true Application - v141 + v142 Unicode true Application - v141 + v142 Unicode Application - v141 + v142 Unicode @@ -80,9 +80,11 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ false + $(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath) false + $(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath)