From 3ffde38c77c00f99cb3a2f1fd5f13864927878f9 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Sun, 21 Jun 2020 17:55:19 +0100 Subject: [PATCH 1/3] Test the Makefile under Linux. --- YSFGateway/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/YSFGateway/Makefile b/YSFGateway/Makefile index fd878b1..d7015c0 100644 --- a/YSFGateway/Makefile +++ b/YSFGateway/Makefile @@ -6,8 +6,8 @@ CFLAGS = -g -O3 -Wall -std=c++0x -pthread LIBS = -lm -lpthread # Use the following CFLAGS and LIBS if you do want to use gpsd. -CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread -LIBS = -lm -lpthread -lgps +#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread +#LIBS = -lm -lpthread -lgps LDFLAGS = -g From 983058fde17820f4522e2619475c22879ba447f0 Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Wed, 24 Jun 2020 11:40:55 +0200 Subject: [PATCH 2/3] Take care if the gpsd API version with gps_read() as function prototype as changed in version 7. --- YSFGateway/APRSWriter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/YSFGateway/APRSWriter.cpp b/YSFGateway/APRSWriter.cpp index fd3ad40..871e758 100644 --- a/YSFGateway/APRSWriter.cpp +++ b/YSFGateway/APRSWriter.cpp @@ -284,8 +284,14 @@ void CAPRSWriter::sendIdFrameMobile() if (!::gps_waiting(&m_gpsdData, 0)) return; +#if GPSD_API_MAJOR_VERSION >= 7 if (::gps_read(&m_gpsdData, NULL, 0) <= 0) return; +#else + if (::gps_read(&m_gpsdData) <= 0) + return; +#endif + if (m_gpsdData.status != STATUS_FIX) return; From 1ce3d6d186816aa864b549a9317b107ca60993c3 Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Wed, 24 Jun 2020 12:05:07 +0200 Subject: [PATCH 3/3] altMSL appeared in API 9. --- YSFGateway/APRSWriter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/YSFGateway/APRSWriter.cpp b/YSFGateway/APRSWriter.cpp index 871e758..ae9e7cb 100644 --- a/YSFGateway/APRSWriter.cpp +++ b/YSFGateway/APRSWriter.cpp @@ -306,7 +306,11 @@ void CAPRSWriter::sendIdFrameMobile() float rawLatitude = float(m_gpsdData.fix.latitude); float rawLongitude = float(m_gpsdData.fix.longitude); +#if GPSD_API_MAJOR_VERSION >= 9 float rawAltitude = float(m_gpsdData.fix.altMSL); +#else + float rawAltitude = float(m_gpsdData.fix.altitude); +#endif float rawVelocity = float(m_gpsdData.fix.speed); float rawBearing = float(m_gpsdData.fix.track);