diff options
author | Jon Schlueter <jschlueter@redhat.com> | 2016-01-05 02:07:52 -0500 |
---|---|---|
committer | Jon Schlueter <jschlueter@redhat.com> | 2016-01-05 02:10:40 -0500 |
commit | ac1d661e141cbaec067fdb6a4cd2d06a1ae13fa6 (patch) | |
tree | 885d247ffb17dc5c8763ec3d76dbbe3bc6eadcc1 /drivers.c | |
parent | db69281bbd3c60b38b4fa489944492a7a8a739d6 (diff) | |
download | gpsd-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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 */ |