summaryrefslogtreecommitdiff
path: root/gpsfake
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2016-03-03 17:05:16 -0800
committerJon Schlueter <jon.schlueter@gmail.com>2016-03-03 23:00:50 -0500
commitd42f3f9d1a770a6adcbfd3d7a232206268fc2bd0 (patch)
tree9dc86f79b2f0be017bda568fce07f9e2c6168b70 /gpsfake
parent47e4b4b7c0f50a1b9d961b74970f67966d9ce0fb (diff)
downloadgpsd-d42f3f9d1a770a6adcbfd3d7a232206268fc2bd0.tar.gz
Makes gpsfake -T take -S into account.
This makes it possible to view the "slow" as well as the normal WRITE_PAD values with gpsfake -T, without having to look at the source code. It adds a new GetDelay() function to fake.py, which returns the proper delay value, taking into account both the possible environment variable and the "slow" option. This is now used for all hree uses of WRITE_PAD. Because the environment override is now part of the function, the WRITE_PAD constant is no longer modified by the environment value, but instead reflects the platform default. TESTED: Ran the full set of regression tests, with both default and acceptably shortened WRITE_PAD. Also verified that a zero value causes trouble (OSX), and that adding -S to the zero value makes it work. Signed-off-by: Jon Schlueter <jon.schlueter@gmail.com>
Diffstat (limited to 'gpsfake')
-rwxr-xr-xgpsfake2
1 files changed, 1 insertions, 1 deletions
diff --git a/gpsfake b/gpsfake
index 298a8856..6c333969 100755
--- a/gpsfake
+++ b/gpsfake
@@ -152,7 +152,7 @@ if __name__ == '__main__':
elif switch == '-t':
tcp = True
elif switch == '-T':
- sys.stdout.write("sys %s platform %s: WRITE_PAD = %.5f\n" % (sys.platform, platform.platform(), gpsfake.WRITE_PAD))
+ sys.stdout.write("sys %s platform %s: WRITE_PAD = %.5f\n" % (sys.platform, platform.platform(), gpsfake.GetDelay(slow)))
raise SystemExit, 0
elif switch == '-u':
udp = True