summaryrefslogtreecommitdiff
path: root/drivers.c
diff options
context:
space:
mode:
authorJon Schlueter <jschlueter@redhat.com>2016-01-05 02:07:52 -0500
committerJon Schlueter <jschlueter@redhat.com>2016-01-05 02:10:40 -0500
commitac1d661e141cbaec067fdb6a4cd2d06a1ae13fa6 (patch)
tree885d247ffb17dc5c8763ec3d76dbbe3bc6eadcc1 /drivers.c
parentdb69281bbd3c60b38b4fa489944492a7a8a739d6 (diff)
downloadgpsd-ac1d661e141cbaec067fdb6a4cd2d06a1ae13fa6.tar.gz
[aivdm] expand debugging in aivdm_decode
add tracing for each of the broken up fields add pad to the tracing that was already there
Diffstat (limited to 'drivers.c')
-rw-r--r--drivers.c9
1 files changed, 7 insertions, 2 deletions
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;i<nfields;i++)
+ gpsd_log(&session->context->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 */