From d631d2a3c35baac66d75acea0b2e25a6b804c7e1 Mon Sep 17 00:00:00 2001 From: Serhii Voloshynov Date: Tue, 8 Feb 2022 15:56:18 +0200 Subject: [PATCH] gpsd: add fixes to support new gpsd 3.23 --- libloragw/inc/loragw_gps.h | 1 + libloragw/tst/test_loragw_gps.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libloragw/inc/loragw_gps.h b/libloragw/inc/loragw_gps.h index 0714974..dd4aa0f 100644 --- a/libloragw/inc/loragw_gps.h +++ b/libloragw/inc/loragw_gps.h @@ -27,6 +27,7 @@ Maintainer: Michael Coracin #include /* time library */ #include /* speed_t */ #include /* ssize_t */ +#include #include #include #include /* error messages */ diff --git a/libloragw/tst/test_loragw_gps.c b/libloragw/tst/test_loragw_gps.c index 994c0ad..d6706b7 100644 --- a/libloragw/tst/test_loragw_gps.c +++ b/libloragw/tst/test_loragw_gps.c @@ -31,6 +31,7 @@ Maintainer: Michael Coracin #include /* sigaction */ #include /* exit */ #include /* read */ +#include #include #include @@ -128,7 +129,7 @@ int main() while ((quit_sig != 1) && (exit_sig != 1)) { wait_ms(100); int r = gps_read(&gpsdata, 0, 0); - if (r!= -1 && (gpsdata.status != STATUS_NO_FIX) && + if (r!= -1 && (gpsdata.fix.status != STATUS_NO_FIX) && (gpsdata.fix.mode == MODE_2D || gpsdata.fix.mode == MODE_3D) && !isnan(gpsdata.fix.latitude) && !isnan(gpsdata.fix.longitude)) { @@ -142,7 +143,7 @@ int main() printf("\n--- GPS ---\n"); printf("Set: %lld\n", gpsdata.set); printf("Online: %10.0f\n", gpsdata.online); - printf("Status: %d\n", gpsdata.status); + printf("Status: %d\n", gpsdata.fix.status); printf("Satellites Used: %d\n", gpsdata.satellites_used); printf("Mode: %d\n", gpsdata.fix.mode); printf("UTC time: %lld.%09ld\n", (long long)time_reference_gps.utc.tv_sec, time_reference_gps.utc.tv_nsec); -- 2.25.1