diff --git a/Common/APRSWriter.cpp b/Common/APRSWriter.cpp index 24c8463..3fab725 100644 --- a/Common/APRSWriter.cpp +++ b/Common/APRSWriter.cpp @@ -125,7 +125,7 @@ m_array(), m_aprsAddress(), m_aprsPort(port), m_aprsSocket() -#if !defined(_WIN32) && !defined(_WIN64) +#if defined(USE_GPSD) ,m_gpsdEnabled(false), m_gpsdAddress(), m_gpsdPort(), @@ -162,7 +162,7 @@ void CAPRSWriter::setPortFixed(const wxString& callsign, const wxString& band, d void CAPRSWriter::setPortGPSD(const wxString& callsign, const wxString& band, double frequency, double offset, double range, const wxString& address, const wxString& port) { -#if !defined(_WIN32) && !defined(_WIN64) +#if defined(USE_GPSD) wxASSERT(!address.IsEmpty()); wxASSERT(!port.IsEmpty()); @@ -180,7 +180,7 @@ void CAPRSWriter::setPortGPSD(const wxString& callsign, const wxString& band, do bool CAPRSWriter::open() { -#if !defined(_WIN32) && !defined(_WIN64) +#if defined(USE_GPSD) if (m_gpsdEnabled) { int ret = ::gps_open(m_gpsdAddress.mb_str(), m_gpsdPort.mb_str(), &m_gpsdData); if (ret != 0) { @@ -293,7 +293,7 @@ void CAPRSWriter::clock(unsigned int ms) { m_idTimer.clock(ms); -#if !defined(_WIN32) && !defined(_WIN64) +#if defined(USE_GPSD) if (m_gpsdEnabled) { if (m_idTimer.hasExpired()) { sendIdFramesMobile(); @@ -307,7 +307,7 @@ void CAPRSWriter::clock(unsigned int ms) m_idTimer.setTimeout(20U * 60U); m_idTimer.start(); } -#if !defined(_WIN32) && !defined(_WIN64) +#if defined(USE_GPSD) } #endif for (CEntry_t::iterator it = m_array.begin(); it != m_array.end(); ++it) @@ -318,7 +318,7 @@ void CAPRSWriter::close() { m_aprsSocket.close(); -#if !defined(_WIN32) && !defined(_WIN64) +#if defined(USE_GPSD) if (m_gpsdEnabled) { ::gps_stream(&m_gpsdData, WATCH_DISABLE, NULL); ::gps_close(&m_gpsdData); @@ -439,6 +439,7 @@ void CAPRSWriter::sendIdFramesFixed() } } +#if defined(USE_GPSD) void CAPRSWriter::sendIdFramesMobile() { if (!m_gpsdEnabled) @@ -596,4 +597,4 @@ void CAPRSWriter::sendIdFramesMobile() } } } - +#endif diff --git a/Common/APRSWriter.h b/Common/APRSWriter.h index 6c9b016..b4d48c3 100644 --- a/Common/APRSWriter.h +++ b/Common/APRSWriter.h @@ -27,7 +27,7 @@ #include "Timer.h" #include "Defs.h" -#if !defined(_WIN32) && !defined(_WIN64) +#if defined(USE_GPSD) #include #endif @@ -95,7 +95,7 @@ private: in_addr m_aprsAddress; unsigned int m_aprsPort; CUDPReaderWriter m_aprsSocket; -#if !defined(_WIN32) && !defined(_WIN64) +#if defined(USE_GPSD) bool m_gpsdEnabled; wxString m_gpsdAddress; wxString m_gpsdPort; diff --git a/Common/Version.h b/Common/Version.h index 1760cbc..477d0c1 100644 --- a/Common/Version.h +++ b/Common/Version.h @@ -24,9 +24,9 @@ const wxString VENDOR_NAME = wxT("G4KLX"); #if defined(__WXDEBUG__) -const wxString VERSION = wxT("20200605 - DEBUG"); +const wxString VERSION = wxT("20200621 - DEBUG"); #else -const wxString VERSION = wxT("20190605"); +const wxString VERSION = wxT("20190621"); #endif #endif diff --git a/Makefile b/Makefile index 041add6..b3d02ec 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,9 @@ 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) @@ -23,7 +26,7 @@ ifeq ($(BUILD), debug) else ifeq ($(BUILD), release) export CFLAGS := $(CFLAGS) $(RELEASEFLAGS) endif -export LIBS := $(shell wx-config --libs base,net) -lgps +export LIBS := $(shell wx-config --libs base,net) export LDFLAGS := .PHONY: all diff --git a/MakefileGUI b/MakefileGUI index d208c0c..7bec5e2 100644 --- a/MakefileGUI +++ b/MakefileGUI @@ -13,10 +13,13 @@ 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) -lgps -export LIBS := $(shell wx-config --libs base,net) -lgps +export GUILIBS := $(shell wx-config --libs adv,core,base) +export LIBS := $(shell wx-config --libs base,net) export LDFLAGS := .PHONY: all