fix with newer gpsd, whuch removed deprecated STATUS_NO_FIX in favour

of fix.mode. adapted from upstream commit (whuch added fix.mode but didn't
remove STATUS_NO_FIX)..
This commit is contained in:
sthen 2022-02-27 18:35:08 +00:00
parent 622a8c5ba2
commit f78870d994
2 changed files with 7 additions and 4 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.28 2022/01/25 03:13:41 daniel Exp $
# $OpenBSD: Makefile,v 1.29 2022/02/27 18:35:08 sthen Exp $
COMMENT = lightweight mapping application for use with or without GPS
DISTNAME = foxtrotgps-1.2.2
REVISION = 2
REVISION = 3
CATEGORIES = geo x11

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-src_gps_functions_c,v 1.2 2021/01/13 05:57:44 kirby Exp $
$OpenBSD: patch-src_gps_functions_c,v 1.3 2022/02/27 18:35:08 sthen Exp $
Add support for gpsd API version 9 (gpsd 3.20)
https://bazaar.launchpad.net/~foxtrotgps-team/foxtrotgps/trunk/revision/320
@ -9,6 +9,9 @@ https://bazaar.launchpad.net/~foxtrotgps-team/foxtrotgps/trunk/revision/327
gpsd API 9 has a different altitude reporting
https://bazaar.launchpad.net/~foxtrotgps-team/foxtrotgps/trunk/revision/328
deprecated STATUS_NO_FIX has been removed from.gpsd, based on
https://bazaar.launchpad.net/~foxtrotgps-team/foxtrotgps/trunk/revision/329
Index: src/gps_functions.c
--- src/gps_functions.c.orig
+++ src/gps_functions.c
@ -26,7 +29,7 @@ Index: src/gps_functions.c
gpsdata->fix.time = (time_t) 0;
}
+#if GPSD_API_MAJOR_VERSION >= 10
+ gpsdata->valid = (libgps_gpsdata.fix.status != STATUS_NO_FIX);
+ gpsdata->valid = (libgps_gpsdata.fix.mode >= MODE_2D);
+#else
gpsdata->valid = (libgps_gpsdata.status != STATUS_NO_FIX);
+#endif