MAC program to read NMEA data - Printable Version +- MacSailing.net (https://macsailing.net/mybb) +-- Forum: MacSailing.net (https://macsailing.net/mybb/forum-3.html) +--- Forum: General (https://macsailing.net/mybb/forum-4.html) +--- Thread: MAC program to read NMEA data (/thread-166.html) |
MAC program to read NMEA data - rirvine - June 20, 2006 The following can be used to read the NMEA sentance (all of them) that come down the wire - it read 1000, displays them, and write them to a file. use Device::SerialPort; $port="/dev/cu.KeySerial1"; $ob= Device::SerialPort -> new ($port); $ob-> baudrate(4800); $ob-> parity("none"); $ob-> databits( 8 ); $ob-> handshake("none"); $ob->write_settings; unlink "data.txt"; open (INPUT, "/dev/cu.KeySerial1"); open (OUTPUT, "> data.txt"); $time = localtime(time ()); print "Start Reading NMEA Data ".$time."\n"; $w=0; while ($w < 1000){ $text=readline INPUT; print $text; print OUTPUT $text."\t\n"; $w=$w+1; } If you do not have Device::SerialPort on you MAC, you can download it from www.DarwinPorts.org - GPSNavX - June 20, 2006 Thanks. For those not programatically inclined you can download GPSUtility and just copy and paste the NMEA output in the monitor window. http://www.versiontracker.com/dyn/moreinfo/macosx/24559 |