From ac1d661e141cbaec067fdb6a4cd2d06a1ae13fa6 Mon Sep 17 00:00:00 2001 From: Jon Schlueter Date: Tue, 5 Jan 2016 02:07:52 -0500 Subject: [aivdm] expand debugging in aivdm_decode add tracing for each of the broken up fields add pad to the tracing that was already there --- drivers.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers.c') diff --git a/drivers.c b/drivers.c index dce33c4b..5834bced 100644 --- a/drivers.c +++ b/drivers.c @@ -1219,6 +1219,11 @@ static bool aivdm_decode(const char *buf, size_t buflen, *cp = '\0'; field[nfields++] = cp + 1; } + } +#ifdef __UNDEF_DEBUG_ + for(int i=0;icontext->errout, LOG_DATA, "field [%d] [%s]\n",i,field[i]); +#endif /* discard sentences with exiguous commas; catches run-ons */ if (nfields < 7) { @@ -1273,8 +1278,8 @@ static bool aivdm_decode(const char *buf, size_t buflen, if(isdigit(field[6][0])) pad = field[6][0] - '0'; /* number of padding bits ASCII encoded*/ gpsd_log(&session->context->errout, LOG_PROG, - "nfrags=%d, ifrag=%d, decoded_frags=%d, data=%s\n", - nfrags, ifrag, ais_context->decoded_frags, data); + "nfrags=%d, ifrag=%d, decoded_frags=%d, data=%s, pad=%d\n", + nfrags, ifrag, ais_context->decoded_frags, data, pad); /* assemble the binary data */ -- cgit v1.2.1