Mercurial > ~darius > hgwebdir.cgi > sirf
changeset 5:f3547b32c7c5 default tip
Don't set timeout in parser class otherwise we can't use it for FIFO files.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Fri, 02 Aug 2019 12:14:26 +0930 |
parents | 2fde8c382dae |
children | |
files | sirf.py test.py |
diffstat | 2 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/sirf.py Wed Jun 20 16:48:55 2012 +0930 +++ b/sirf.py Fri Aug 02 12:14:26 2019 +0930 @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (c) 2009 +# Copyright (c) 2019 # Daniel O'Connor <darius@dons.net.au>. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -230,7 +230,6 @@ return pktcount def dumpmsgs(self, s): - s.setTimeout(0.1) while True: self.processstr(s.read(100))
--- a/test.py Wed Jun 20 16:48:55 2012 +0930 +++ b/test.py Fri Aug 02 12:14:26 2019 +0930 @@ -1,6 +1,6 @@ import serial, sirf, sys -# Copyright (c) 2009 +# Copyright (c) 2019 # Daniel O'Connor <darius@dons.net.au>. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -29,17 +29,18 @@ port = sys.argv[1] else: port = '/dev/rfcomm1' - - s = serial.Serial(port = port, baudrate = 9600) + s = serial.Serial(port = port) + s.setTimeout(0.1) s.setBaudrate(4800) s.flush() + # Switch to SiRF and 9600 baud s.write(sirf.nmea2sirf) s.flush() s.setBaudrate(9600) s.flush() - + p = sirf.Parser() sirf.disablemsgs(s)