summaryrefslogtreecommitdiff
path: root/recipes-connectivity/lora/lora-gateway/lora_gateway-gpsd-3.23.patch
blob: 25b0d25c94bab4c687097173320c74bca00858e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From d631d2a3c35baac66d75acea0b2e25a6b804c7e1 Mon Sep 17 00:00:00 2001
From: Serhii Voloshynov <serhii.voloshynov@globallogic.com>
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.h>       /* time library */
 #include <termios.h>    /* speed_t */
 #include <unistd.h>     /* ssize_t */
+#include <gpsd_config.h>
 #include <gpsd.h>
 #include <gpsdclient.h>
 #include <errno.h>      /* 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 <signal.h>     /* sigaction */
 #include <stdlib.h>     /* exit */
 #include <unistd.h>     /* read */
+#include <gpsd_config.h>
 #include <gps.h>
 #include <gpsd.h>
 
@@ -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