# HG changeset patch # User Daniel O'Connor # Date 1564713866 -34200 # Node ID f3547b32c7c51fc4acb63b529a49e2d6249b03ab # Parent 2fde8c382dae0c5707ba6eea0c17dfa0be1af6ac Don't set timeout in parser class otherwise we can't use it for FIFO files. diff -r 2fde8c382dae -r f3547b32c7c5 sirf.py --- 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 . 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)) diff -r 2fde8c382dae -r f3547b32c7c5 test.py --- 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 . 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)