summaryrefslogtreecommitdiff
path: root/cgps.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-10-01 19:48:29 -0700
committerGary E. Miller <gem@rellim.com>2018-10-01 19:48:29 -0700
commitd48ec002ee529da3f4d51b70d19e2a9ee8e7367d (patch)
tree5ddfe7e8232de9acc8870f9e3d3c8c55154c04d7 /cgps.c
parent907adae59de58634fd06ee68986a5070f5c01ddd (diff)
downloadgpsd-d48ec002ee529da3f4d51b70d19e2a9ee8e7367d.tar.gz
cgps: Add JSON version check.
Diffstat (limited to 'cgps.c')
-rw-r--r--cgps.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/cgps.c b/cgps.c
index 1fda727a..a5e6334c 100644
--- a/cgps.c
+++ b/cgps.c
@@ -547,6 +547,20 @@ static void update_gps_panel(struct gps_data_t *gpsdata, char *message)
gpsdata->satellites_visible,
gpsdata->satellites_used);
+ if (0 != (VERSION_SET &gpsdata->set)) {
+ /* got version, check it */
+ /* FIXME: expected API version not available ? */
+ if (0 != strcmp(gpsdata->version.release, VERSION)) {
+ (void)fprintf(stderr, "cgps: WARNING gpsd release %s, API: %d.%d, "
+ "expected %s ",
+ gpsdata->version.release,
+ gpsdata->version.proto_major,
+ gpsdata->version.proto_minor,
+ VERSION);
+ sleep(2);
+ }
+ }
+
if (gpsdata->satellites_visible != 0) {
int sat_no;
int loop_end = (display_sats < gpsdata->satellites_visible) ? \