summaryrefslogtreecommitdiff
path: root/gpsdecode.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-28 22:03:20 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-28 22:03:20 +0000
commitc79c8ce1c7e01cd78f5a0b112e011a75c8c87c01 (patch)
tree6a288f001f0bdefe792e4e8525150c2cdc3829c0 /gpsdecode.c
parent5184ba2d3699469bd57420d999cfe9d9f8cb4843 (diff)
downloadgpsd-c79c8ce1c7e01cd78f5a0b112e011a75c8c87c01.tar.gz
New CSV AIS dump code is verified correct.
All regression tests pass.
Diffstat (limited to 'gpsdecode.c')
-rw-r--r--gpsdecode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gpsdecode.c b/gpsdecode.c
index f80c7af3..150a1751 100644
--- a/gpsdecode.c
+++ b/gpsdecode.c
@@ -372,7 +372,10 @@ static void decode(FILE *fpin, FILE *fpout)
else if (lexer.type == AIVDM_PACKET) {
/*@ -uniondef */
if (aivdm_decode((char *)lexer.outbuffer, lexer.outbuflen, &aivdm)){
- aivdm_dump(&aivdm.decoded, scaled, json, buf, sizeof(buf));
+ if (!json)
+ aivdm_csv_dump(&aivdm.decoded, buf, sizeof(buf));
+ else
+ aivdm_dump(&aivdm.decoded, scaled, json, buf, sizeof(buf));
(void)fputs(buf, fpout);
(void)fputs("\n", fpout);
}
@@ -415,7 +418,7 @@ static void encode(FILE *fpin, bool repack, FILE *fpout)
memset(&lexer, 0, sizeof(lexer));
} else {
/* this works */
- char outbuf[BUFSIZ];
+ char outbuf[BUFSIZ];
rtcm2_json_dump(&gpsdata.rtcm2, outbuf, sizeof(outbuf));
(void)fputs(outbuf, fpout);
}