summaryrefslogtreecommitdiff
path: root/ais_json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-05-30 18:41:32 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-05-30 18:41:32 -0400
commit0e98bf00b5a63798e30026d9198892b7c24c4c71 (patch)
tree05e99e5d32b91d7fd5c678b932bfe9139bc6bde3 /ais_json.c
parenta6559a248a72189c0119e2e768a3a8e4ed96c64f (diff)
downloadgpsd-0e98bf00b5a63798e30026d9198892b7c24c4c71.tar.gz
In AIS, Route info (broadcast) support.
Diffstat (limited to 'ais_json.c')
-rw-r--r--ais_json.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/ais_json.c b/ais_json.c
index efdcce1c..cb660e72 100644
--- a/ais_json.c
+++ b/ais_json.c
@@ -181,6 +181,17 @@ int json_ais_read(const char *buf,
}
else if (strstr(buf, "\"fid\":28,") != NULL) {
status = json_read_object(buf, json_ais6_fid28, endptr);
+ if (status == 0) {
+ ais->type6.dac1fid28.month = AIS_MONTH_NOT_AVAILABLE;
+ ais->type6.dac1fid28.day = AIS_DAY_NOT_AVAILABLE;
+ ais->type6.dac1fid28.hour = AIS_HOUR_NOT_AVAILABLE;
+ ais->type6.dac1fid28.minute = AIS_MINUTE_NOT_AVAILABLE;
+ (void)sscanf(start, "%02u-%02uT%02u:%02uZ",
+ &ais->type6.dac1fid28.month,
+ &ais->type6.dac1fid28.day,
+ &ais->type6.dac1fid28.hour,
+ &ais->type6.dac1fid28.minute);
+ }
imo = true;
}
else if (strstr(buf, "\"fid\":30,") != NULL) {
@@ -238,6 +249,17 @@ int json_ais_read(const char *buf,
}
else if (strstr(buf, "\"fid\":27,") != NULL) {
status = json_read_object(buf, json_ais8_fid27, endptr);
+ if (status == 0) {
+ ais->type8.dac1fid27.month = AIS_MONTH_NOT_AVAILABLE;
+ ais->type8.dac1fid27.day = AIS_DAY_NOT_AVAILABLE;
+ ais->type8.dac1fid27.hour = AIS_HOUR_NOT_AVAILABLE;
+ ais->type8.dac1fid27.minute = AIS_MINUTE_NOT_AVAILABLE;
+ (void)sscanf(start, "%02u-%02uT%02u:%02uZ",
+ &ais->type8.dac1fid27.month,
+ &ais->type8.dac1fid27.day,
+ &ais->type8.dac1fid27.hour,
+ &ais->type8.dac1fid27.minute);
+ }
imo = true;
}
else if (strstr(buf, "\"fid\":29,") != NULL) {