[PATCH] Updated GPS code so that it is compatible with new gpsd version.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/baseband-devel@lists.osmocom.org/.

Konstantin Weitz konnew at gmx.de
Tue Jun 28 03:41:27 UTC 2011


---
 src/host/layer23/src/common/gps.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/host/layer23/src/common/gps.c $REPLACE$
index 38aae2c..ffdaa1a 100644
--- a/src/host/layer23/src/common/gps.c
+++ b/src/host/layer23/src/common/gps.c
@@ -70,11 +70,14 @@ int osmo_gpsd_cb(struct osmo_fd *bfd, unsigned int what)
 	    goto gps_not_ready;
 
 	/* gps has no data */
-	if (gps_waiting(gdata))
+	
+	// 10 seconds timeout, only place where
+	// logic was changed to upgrade to new gpsd
+	if (gps_waiting(gdata,10000000)) 
 	    goto gps_not_ready;
 
 	/* polling returned an error */
-	if (gps_poll(gdata))
+	if (gps_read(gdata))
 	    goto gps_not_ready;
 
 	/* data are valid */
@@ -111,7 +114,9 @@ int osmo_gpsd_open(void)
 	gps_bfd.when = BSC_FD_READ;
 	gps_bfd.cb = osmo_gpsd_cb;
 
-	gdata = gps_open(g.gpsd_host, g.gpsd_port);
+	gdata = malloc(sizeof(struct gps_data_t));
+
+	gps_open(g.gpsd_host, g.gpsd_port, gdata);
 	if (gdata == NULL) {
 		LOGP(DGPS, LOGL_ERROR, "Can't connect to gpsd\n");
 		return -1;
-- 
1.7.5.2






More information about the baseband-devel mailing list