diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-06-05 12:16:48 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-06-05 12:16:48 +0000 |
commit | 15a5fd5d762a9545d4838bbfa077d7f893cefad0 (patch) | |
tree | 767639e968cf529714384e1a44a24b261f1e116b /gpsdecode.c | |
parent | d0ca67ef07a275509ad6bea4496283815219dcca (diff) | |
download | gpsd-15a5fd5d762a9545d4838bbfa077d7f893cefad0.tar.gz |
First cut at JSON dumping of AIVDM.
Will need some cleanup, but the basic logic is in place.
Diffstat (limited to 'gpsdecode.c')
-rw-r--r-- | gpsdecode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gpsdecode.c b/gpsdecode.c index 194a498d..0653df4d 100644 --- a/gpsdecode.c +++ b/gpsdecode.c @@ -16,7 +16,7 @@ static int verbose = 0; static bool scaled = true; -static bool labeled = false; +static bool json = false; /************************************************************************** * @@ -66,7 +66,7 @@ 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, labeled, stdout); + aivdm_dump(&aivdm.decoded, scaled, json, stdout); /*@ +uniondef */ } } @@ -150,7 +150,7 @@ int main(int argc, char **argv) bool striphdr = false; enum {doencode, dodecode, passthrough} mode = dodecode; - while ((c = getopt(argc, argv, "dhelpuVD:")) != EOF) { + while ((c = getopt(argc, argv, "dhejpuVD:")) != EOF) { switch (c) { case 'd': mode = dodecode; @@ -164,8 +164,8 @@ int main(int argc, char **argv) striphdr = true; break; - case 'l': - labeled = true; + case 'j': + json = true; break; case 'p': /* undocumented, used for regression-testing */ |