summaryrefslogtreecommitdiff
path: root/ais_json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-04-25 21:34:51 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-04-25 21:34:51 -0400
commit0d31c2b7eaa32f6e806b0b380d6b52db2e8c1b77 (patch)
treef08a55acfe3c1aeb348291257741d07d6549c324 /ais_json.c
parent9b4c8351607a8f1e1389116b1cbcaf482624f1ef (diff)
downloadgpsd-0d31c2b7eaa32f6e806b0b380d6b52db2e8c1b77.tar.gz
In AIS, client-library support for IMO289 FID=18.
Diffstat (limited to 'ais_json.c')
-rw-r--r--ais_json.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/ais_json.c b/ais_json.c
index dbec0e30..0c44a3cf 100644
--- a/ais_json.c
+++ b/ais_json.c
@@ -141,6 +141,19 @@ int json_ais_read(const char *buf,
status = json_read_object(buf, json_ais6_fid16, endptr);
imo = true;
}
+ else if (strstr(buf, "\"fid\":18,") != NULL || strstr(buf, "\"fid\":11,") != NULL) {
+ status = json_read_object(buf, json_ais6_fid18, endptr);
+ if (status == 0) {
+ ais->type6.dac1fid18.day = AIS_DAY_NOT_AVAILABLE;
+ ais->type6.dac1fid18.hour = AIS_HOUR_NOT_AVAILABLE;
+ ais->type6.dac1fid18.minute = AIS_MINUTE_NOT_AVAILABLE;
+ (void)sscanf(eta, "%02uT%02u:%02uZ",
+ &ais->type6.dac1fid18.day,
+ &ais->type6.dac1fid18.hour,
+ &ais->type6.dac1fid18.minute);
+ }
+ imo = true;
+ }
else if (strstr(buf, "\"fid\":25,") != NULL) {
status = json_read_object(buf, json_ais6_fid25, endptr);
imo = true;
@@ -171,13 +184,13 @@ int json_ais_read(const char *buf,
else if (strstr(buf, "\"fid\":31,") != NULL || strstr(buf, "\"fid\":11,") != NULL) {
status = json_read_object(buf, json_ais8_fid31, endptr);
if (status == 0) {
- ais->type5.day = AIS_DAY_NOT_AVAILABLE;
- ais->type5.hour = AIS_HOUR_NOT_AVAILABLE;
- ais->type5.minute = AIS_MINUTE_NOT_AVAILABLE;
+ ais->type8.dac1fid31.day = AIS_DAY_NOT_AVAILABLE;
+ ais->type8.dac1fid31.hour = AIS_HOUR_NOT_AVAILABLE;
+ ais->type8.dac1fid31.minute = AIS_MINUTE_NOT_AVAILABLE;
(void)sscanf(eta, "%02uT%02u:%02uZ",
- &ais->type5.day,
- &ais->type5.hour,
- &ais->type5.minute);
+ &ais->type8.dac1fid31.day,
+ &ais->type8.dac1fid31.hour,
+ &ais->type8.dac1fid31.minute);
}
imo = true;
}