Mercurial > ~darius > hgwebdir.cgi > sirf
view test.py @ 1:c623f8832fd7
Tidy up, take cmd line args.
author | darius@Inchoate |
---|---|
date | Wed, 02 Sep 2009 13:24:44 +0930 |
parents | 6503256a3fc4 |
children | 387e6e928567 |
line wrap: on
line source
import serial, sirf, sys if __name__ == "__main__": if len(sys.argv) > 1: port = sys.argv[1] else: port = '/dev/rfcomm1' s = serial.Serial(port = port, baudrate = 9600) 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) sirf.enablemsgs(s) p.dumpmsgs(s)