Fix build against gpsd >= 3.20 #1

Merged
osmith merged 2 commits from osmith/gpsdate:osmith/wip into master 3 months ago
Collaborator
The previous version was written against gpsd 3.10. This also makes the
date more precise, previously microseconds were set to 0.
    
Related: SYS#6222

Note that in meta-sysmocom-bsp, we have the commit hardcoded. It won't automatically try to build the new version after merge.

``` The previous version was written against gpsd 3.10. This also makes the date more precise, previously microseconds were set to 0. Related: SYS#6222 ``` Note that in meta-sysmocom-bsp, we have the [commit hardcoded](https://gitea.sysmocom.de/sysmo-bts/meta-sysmocom-bsp/src/branch/201705/recipes-extra/gpsdate/gpsdate_git.bb#L15). It won't automatically try to build the new version after merge.
osmith added 1 commit 3 months ago
pespin requested changes 3 months ago
gps-watchdog.c Outdated
#include <gps.h>
#if GPSD_API_MAJOR_VERSION < 11
Collaborator

I'd rather keep supporting older versions by means of ifdef in relevant code parts, or having a function helper defined for different versions. IIRC we are already doing that in some places?

I'd rather keep supporting older versions by means of ifdef in relevant code parts, or having a function helper defined for different versions. IIRC we are already doing that in some places?
Owner

I agree. the tool is a generic open source tool we released (and also announced on the gpsd mailing list when it was created). So we shouldn't constrain it to support only the absolutely latest gpsd client/API versions, but maintain compatibility.

I agree. the tool is a generic open source tool we released (and also announced on the gpsd mailing list when it was created). So we shouldn't constrain it to support only the absolutely latest gpsd client/API versions, but maintain compatibility.
Poster
Collaborator

Done

Done
osmith marked this conversation as resolved
osmith force-pushed osmith/wip from d28feb6cb2 to 54593d77f8 3 months ago
osmith requested review from pespin 3 months ago
pespin approved these changes 3 months ago
gps-watchdog.c Outdated
if (!gps_waiting(gdata, timeout)) {
return -1;
} else {
#if GPSD_API_MAJOR_VERSION >= 7
Collaborator

For this gps_read() function since we always call it with one "variable" param in then, the best is to do a shim. I recall doing that somewhere already in gpsdata or gpsd in the past, look around. Something like:

int compat_gps_read(one_param) {
#if GPSD_API_MAJOR_VERSION >= 7
return gps_read(gdata, NULL, 0);
#else
return gps_read(gdata);
#endif
}

and then use compat_gps_read in all places.

For this gps_read() function since we always call it with one "variable" param in then, the best is to do a shim. I recall doing that somewhere already in gpsdata or gpsd in the past, look around. Something like: int compat_gps_read(one_param) { #if GPSD_API_MAJOR_VERSION >= 7 return gps_read(gdata, NULL, 0); #else return gps_read(gdata); #endif } and then use compat_gps_read in all places.
Poster
Collaborator
Done, found it here: https://gerrit.osmocom.org/c/osmocom-bb/+/11609
osmith marked this conversation as resolved
osmith force-pushed osmith/wip from 54593d77f8 to 68bcf620b4 3 months ago
osmith requested review from pespin 3 months ago
pespin approved these changes 3 months ago
osmith merged commit 68bcf620b4 into master 3 months ago
osmith deleted branch osmith/wip 3 months ago

Reviewers

pespin approved these changes 3 months ago
The pull request has been merged as 68bcf620b4.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: sysmocom/gpsdate#1
Loading…
There is no content yet.