From 531f5384638b9fe3e21e542ce6eed9a39b98fdfb Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 14 Sep 2013 06:54:44 -0400 Subject: Split Type 24 reporting, including the -s option to gpsdecode. All regression tests pass. --- gpsdecode.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gpsdecode.c') diff --git a/gpsdecode.c b/gpsdecode.c index c3673114..0ed7ef50 100644 --- a/gpsdecode.c +++ b/gpsdecode.c @@ -17,6 +17,7 @@ static int verbose = 0; static bool scaled = true; static bool json = true; +static bool split24 = false; static unsigned int ntypes = 0; static unsigned int typelist[32]; @@ -532,6 +533,7 @@ static void decode(FILE *fpin, FILE*fpout) gpsd_clear(&session); session.gpsdata.gps_fd = fileno(fpin); session.gpsdata.dev.baudrate = 38400; /* hack to enable subframes */ + session.gpsdata.policy.split24 = split24; (void)strlcpy(session.gpsdata.dev.path, "stdin", sizeof(session.gpsdata.dev.path)); @@ -621,7 +623,7 @@ int main(int argc, char **argv) enum { doencode, dodecode } mode = dodecode; - while ((c = getopt(argc, argv, "cdejpt:uvVD:")) != EOF) { + while ((c = getopt(argc, argv, "cdejpst:uvVD:")) != EOF) { switch (c) { case 'c': json = false; @@ -639,6 +641,10 @@ int main(int argc, char **argv) json = true; break; + case 's': + split24 = true; + break; + case 't': /*@-nullpass@*/ typelist[ntypes++] = (unsigned int)atoi(strtok(optarg, ",")); -- cgit v1.2.1