diff options
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | gps_json.h | 1 | ||||
-rw-r--r-- | libgps_json.c | 7 |
3 files changed, 9 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 64da5a3d..e31432b9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -146,6 +146,7 @@ libgpsd_c_sources = \ json.c \ libgps.c \ libgps_json.c \ + rtcm2_json.c \ gpsdclient.c \ libgpsd_core.c \ net_dgpsip.c \ @@ -12,6 +12,7 @@ void json_tpv_dump(struct gps_data_t *, struct gps_fix_t *, char *, size_t); void json_sky_dump(struct gps_data_t *, char *, size_t); void json_device_dump(struct gps_device_t *, char *, size_t); void json_watch_dump(struct policy_t *, char *, size_t); +int json_rtcm2_read(const char *, char *, size_t, struct rtcm2_t *, const char **); int libgps_json_unpack(const char *, struct gps_data_t *); /* gps_json.h ends here */ diff --git a/libgps_json.c b/libgps_json.c index 79c4dcd7..e37a6eee 100644 --- a/libgps_json.c +++ b/libgps_json.c @@ -258,6 +258,13 @@ int libgps_json_unpack(const char *buf, struct gps_data_t *gpsdata) } else if (strstr(buf, "\"class\":\"VERSION\"") != 0) { return json_version_read(buf, gpsdata, NULL); + } else if (strstr(buf, "\"class\":\"RTCM2\"") != 0) { + status = json_rtcm2_read(buf, + gpsdata->dev.path, sizeof(gpsdata->dev.path), + &gpsdata->rtcm2, NULL); + if (status == 0) + gpsdata->set |= RTCM2_SET; + return status; } else if (strstr(buf, "\"class\":\"ERROR\"") != 0) { return json_error_read(buf, gpsdata, NULL); } else |