summaryrefslogtreecommitdiff
path: root/gpsdecode.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-09-14 06:54:44 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-09-14 06:57:44 -0400
commit531f5384638b9fe3e21e542ce6eed9a39b98fdfb (patch)
tree8bb2f3db54e8243f874d61c7ea58f7a5a0e70041 /gpsdecode.c
parentea0b84da541fb6e69d03a9dc85c399c7e4fff4cd (diff)
downloadgpsd-531f5384638b9fe3e21e542ce6eed9a39b98fdfb.tar.gz
Split Type 24 reporting, including the -s option to gpsdecode.
All regression tests pass.
Diffstat (limited to 'gpsdecode.c')
-rw-r--r--gpsdecode.c8
1 files changed, 7 insertions, 1 deletions
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, ","));