Mercurial > ~darius > hgwebdir.cgi > sirf
view test.py @ 2:d6d9fba5464d
Log more info and in a better fashion.
author | darius@Inchoate |
---|---|
date | Wed, 02 Sep 2009 13:27:13 +0930 |
parents | c623f8832fd7 |
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)