Bug 40996 - gpsd provider fails (compile) with gpsd v3.1
Summary: gpsd provider fails (compile) with gpsd v3.1
Status: RESOLVED WONTFIX
Alias: None
Product: GeoClue
Classification: Unclassified
Component: Backends (obsolete) (show other bugs)
Version: unspecified
Hardware: x86 (IA32) All
: medium major
Assignee: Geoclue Bugs
QA Contact: Geoclue Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-18 16:20 UTC by orbisvicis
Modified: 2013-09-09 14:50 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Transition to use of new libgps API (2.28 KB, patch)
2011-12-14 03:47 UTC, James Page
Details | Splinter Review

Description orbisvicis 2011-09-18 16:20:33 UTC
log:

geoclue-gpsd.c:43:27: error: ‘gps_data’ redeclared as different kind of symbol
/usr/include/gps.h:1713:35: note: previous declaration of ‘gps_data’ was here
geoclue-gpsd.c: In function ‘geoclue_gpsd_start_gpsd’:
geoclue-gpsd.c:400:2: error: too few arguments to function ‘gps_open’
/usr/include/gps.h:1705:12: note: declared here
geoclue-gpsd.c:402:57: error: ‘POLL_NONBLOCK’ undeclared (first use in this function)
geoclue-gpsd.c:402:57: note: each undeclared identifier is reported only once for each function it appears in
geoclue-gpsd.c:403:3: error: implicit declaration of function ‘gps_set_raw_hook’ [-Werror=implicit-function-declaratio
geoclue-gpsd.c: In function ‘gpsd_poll’:
geoclue-gpsd.c:416:3: error: implicit declaration of function ‘gps_poll’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors


packages:

gcc 4.6.1
gpsd 3.1.1
geoclue-git
Linux 3.0-ARCH i686


other:

I spoke to lind-@irc.freenode.net/gpsd who suggested the implementation http://lindi.iki.fi/lindi/gpsd/gpsd-test3.c might be better than parsing nmea strings (though there might be a reason to insist on nmea)
... (geoclue-gpsd.c)
gps_stream(self->gpsdata, WATCH_ENABLE | WATCH_NMEA | POLL_NONBLOCK, NULL);
gps_set_raw_hook (self->gpsdata, gpsd_raw_hook);
...
Whatever the case, fixing this is probably more complex than drop-in replacements, so filing here.
Comment 1 Bernd Zeimetz 2011-11-19 03:44:15 UTC
Parsing NMEA strings is definitely the wrong way. IMHO the whole gpsd provider needs to be rewritten from scratch.

lindi's implementation is not uptodate for API v5 anymore, too. gps_poll is gone for good.
Comment 2 James Page 2011-12-14 03:47:11 UTC
Created attachment 54418 [details] [review]
Transition to use of new libgps API

I hit this bug whilst transitioning packages to the new libgps API.

The attached patch refactors the codebase to support the new API whilst maintaining backwards compatibility.
Comment 3 Bernd Zeimetz 2011-12-15 02:57:24 UTC
Looking at the patch I'd think it should work, I'll give it a try later.

But on the long run the whole code should be rewritten to avoid parsing NMEA strings as this is prone to errors. Just take the code as suggested in comment #1
Comment 4 Bernd Zeimetz 2011-12-15 02:58:33 UTC
(In reply to comment #3)
> Looking at the patch I'd think it should work, I'll give it a try later.
> 
> But on the long run the whole code should be rewritten to avoid parsing NMEA
> strings as this is prone to errors. Just take the code as suggested in comment
> #1

actually not in the comment but in the bug report... http://lindi.iki.fi/lindi/gpsd/gpsd-test3.c
Comment 5 Zeeshan Ali 2013-09-09 14:50:20 UTC
Closing all bugs on old geoclue. If your bug still applies to new geoclue, please do re-open, I really don't have time to go through each and every bug and evaluate separately. :( Apologies for any inconvenience caused by this change.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.