diff options
author | Fred Wright <fw@fwright.net> | 2016-03-03 17:05:16 -0800 |
---|---|---|
committer | Jon Schlueter <jon.schlueter@gmail.com> | 2016-03-03 23:00:50 -0500 |
commit | d42f3f9d1a770a6adcbfd3d7a232206268fc2bd0 (patch) | |
tree | 9dc86f79b2f0be017bda568fce07f9e2c6168b70 /gpsfake | |
parent | 47e4b4b7c0f50a1b9d961b74970f67966d9ce0fb (diff) | |
download | gpsd-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-x | gpsfake | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |