diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-05 16:08:16 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-05 16:08:16 -0400 |
commit | 29490bea97ad271b842c235eefa99e8dd43ad854 (patch) | |
tree | 4deec7e780e355518210b0388d7090988ce38055 /ais_json.c | |
parent | cb9d852d2217e2e9b8c7ecf25e034bd932bc1a23 (diff) | |
download | gpsd-29490bea97ad271b842c235eefa99e8dd43ad854.tar.gz |
Implement handling of Inland AIS EMMA warning.
Diffstat (limited to 'ais_json.c')
-rw-r--r-- | ais_json.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -330,6 +330,34 @@ int json_ais_read(const char *buf, status = json_read_object(buf, json_ais8_fid19, endptr); imo = true; } + else if (strstr(buf, "\"fid\":23,") != NULL) { + status = json_read_object(buf, json_ais8_fid23, endptr); + ais->type8.dac200fid23.start_year = AIS_YEAR_NOT_AVAILABLE; + ais->type8.dac200fid23.start_month = AIS_MONTH_NOT_AVAILABLE; + ais->type8.dac200fid23.start_day = AIS_DAY_NOT_AVAILABLE; + ais->type8.dac200fid23.start_hour = AIS_HOUR_NOT_AVAILABLE; + ais->type8.dac200fid23.start_minute = AIS_MINUTE_NOT_AVAILABLE; + ais->type8.dac200fid23.end_year = AIS_YEAR_NOT_AVAILABLE; + ais->type8.dac200fid23.end_month = AIS_MONTH_NOT_AVAILABLE; + ais->type8.dac200fid23.end_day = AIS_DAY_NOT_AVAILABLE; + ais->type8.dac200fid23.end_hour = AIS_HOUR_NOT_AVAILABLE; + ais->type8.dac200fid23.end_minute = AIS_MINUTE_NOT_AVAILABLE; + // cppcheck-suppress uninitvar + (void)sscanf(start, "%09u-%02u-%02uT%02u:%02u", + &ais->type8.dac200fid23.start_year, + &ais->type8.dac200fid23.start_month, + &ais->type8.dac200fid23.start_day, + &ais->type8.dac200fid23.start_hour, + &ais->type8.dac200fid23.start_minute); + // cppcheck-suppress uninitvar + (void)sscanf(end, "%09u-%02u-%02uT%02u:%02u", + &ais->type8.dac200fid23.end_year, + &ais->type8.dac200fid23.end_month, + &ais->type8.dac200fid23.end_day, + &ais->type8.dac200fid23.end_hour, + &ais->type8.dac200fid23.end_minute); + imo = true; + } else if (strstr(buf, "\"fid\":27,") != NULL) { status = json_read_object(buf, json_ais8_fid27, endptr); if (status == 0) { |