diff options
author | Gary E. Miller <gem@rellim.com> | 2018-10-01 19:48:29 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-10-01 19:48:29 -0700 |
commit | d48ec002ee529da3f4d51b70d19e2a9ee8e7367d (patch) | |
tree | 5ddfe7e8232de9acc8870f9e3d3c8c55154c04d7 /cgps.c | |
parent | 907adae59de58634fd06ee68986a5070f5c01ddd (diff) | |
download | gpsd-d48ec002ee529da3f4d51b70d19e2a9ee8e7367d.tar.gz |
cgps: Add JSON version check.
Diffstat (limited to 'cgps.c')
-rw-r--r-- | cgps.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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) ? \ |