summaryrefslogtreecommitdiff
path: root/gps
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-04-26 20:42:46 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-04-26 20:42:46 -0400
commitce62d6d9753acc7f8304ac4fae5b3482a3aa55fb (patch)
tree689732ef9cde8504d7c0564463498180fccfead6 /gps
parenta3b524117cf99c312bcaa6369b212c69698f21b5 (diff)
downloadgpsd-ce62d6d9753acc7f8304ac4fae5b3482a3aa55fb.tar.gz
Restore interpretation of Serial: headers inb test loads.
And allow an explicit speed argument to override them.
Diffstat (limited to 'gps')
-rw-r--r--gps/fake.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gps/fake.py b/gps/fake.py
index 2d709b72..edac8e33 100644
--- a/gps/fake.py
+++ b/gps/fake.py
@@ -180,6 +180,9 @@ class FakePTY(FakeGPS):
speed=4800, databits=8, parity='N', stopbits=1,
progress=None):
FakeGPS.__init__(self, testload, progress)
+ # Allow Serial: header to be overridden by explicit spped.
+ if self.testload.serial:
+ (speed, databits, parity, stopbits) = self.testload.serial
self.speed = speed
baudrates = {
0: termios.B0,
@@ -203,9 +206,6 @@ class FakePTY(FakeGPS):
230400: termios.B230400,
}
speed = baudrates[speed] # Throw an error if the speed isn't legal
- # FIXME: explicit arguments should probably override this
- #if self.testload.serial:
- # (speed, databits, parity, stopbits) = self.testload.serial
(self.fd, self.slave_fd) = pty.openpty()
self.byname = os.ttyname(self.slave_fd)
(iflag, oflag, cflag, lflag, ispeed, ospeed, cc) = termios.tcgetattr(self.slave_fd)