summaryrefslogtreecommitdiff
path: root/gpsdecode.c
diff options
context:
space:
mode:
authorChristian Gagneraud <cgagneraud@techworks.ie>2012-06-01 16:57:22 +0100
committerChristian Gagneraud <chris@techworks.ie>2012-06-20 10:05:40 +0100
commit353a26d3e7ebff1a913c227d8768ae042e676eb3 (patch)
treed5e5bc2bd25c7b5833008830aeb1601876b59bbe /gpsdecode.c
parent13058fdfecf9ce0dd992162fa03645187946f4ca (diff)
downloadgpsd-353a26d3e7ebff1a913c227d8768ae042e676eb3.tar.gz
gpsdecode: honor scale flag
Currently gpsdecode doesn't care about the -u (unscaled) flag. Fix that. This patch will allow aivdm-regress to run tests in scaled mode. scons check passed.
Diffstat (limited to 'gpsdecode.c')
-rw-r--r--gpsdecode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gpsdecode.c b/gpsdecode.c
index 3ade9b8c..51a9c2eb 100644
--- a/gpsdecode.c
+++ b/gpsdecode.c
@@ -511,6 +511,7 @@ static void decode(FILE *fpin, FILE*fpout)
//(void)strlcpy(session.gpsdata.dev.path, "stdin", sizeof(session.gpsdata.dev.path));
memset(&policy, '\0', sizeof(policy));
policy.json = json;
+ policy.scaled = scaled;
gps_context_init(&context);
gpsd_time_init(&context, time(NULL));
@@ -576,6 +577,9 @@ static void encode(FILE *fpin, FILE *fpout)
"stdin",
sizeof(session.gpsdata.dev.path));
policy.json = true;
+ /* Parsing is always made in unscaled mode,
+ * this policy applies to the dumping */
+ policy.scaled = scaled;
while (fgets(inbuf, (int)sizeof(inbuf), fpin) != NULL) {
int status;