diff test.py @ 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 387e6e928567
children
line wrap: on
line diff
--- 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)