Compile error with gpsd 2.96 in layer23
Konstantin Weitz
konnew at gmx.de
Tue Jun 28 05:49:40 CEST 2011
Holger Hans Peter Freyther <holger <at> freyther.de> writes:
>
> On 06/01/2011 04:32 PM, Malte Krupa wrote:
> > Dear folks,
> >
> > I recently played with osmocomBB and wanted to try out the
> > cell_log and gsmmap feature.
> > Therefore I tried to rebuild osmocomBB (sylvains testing tree) with gpsd
> > 2.96 installed on archlinux kernel 2.6.38.
> >
> > If there is more information needed, just tell me!
>
> well, you could try to
>
> a) check the ChangeLog of GPSD if there was a change in the API.
> b) patch it.
>
> holger
>
>
Apply this patch and it should work
Change $REPLACE$ to b/src/host/layer23/src/common/gps.c
before applying the patch
>From dc8fb3325a301a84aac33f1db967dc31bb0b7dfc Mon Sep 17 00:00:00 2001
From: Konstantin Weitz <konnew at gmx.de>
Date: Mon, 27 Jun 2011 20:41:27 -0700
Subject: [PATCH] Updated GPS code so that it is compatible with new gpsd
version.
---
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