#! /usr/bin/perl # $GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A # # Where: # RMC Recommended Minimum sentence C # 123519 Fix taken at 12:35:19 UTC # A Status A=active or V=Void. # 4807.038,N Latitude 48 deg 07.038' N # 01131.000,E Longitude 11 deg 31.000' E # 022.4 Speed over the ground in knots # 084.4 Track angle in degrees True # 230394 Date - 23rd of March 1994 # 003.1,W Magnetic Variation # *6A The checksum data, always begins with * # Note that, as of the 2.3 release of NMEA, there is a new field in the RMC sentence at the end just prior to the checksum. For more information on this field see here. # use lib $ENV{DAQLIB}; use perltools::MRtime; my $update = 1; # seconds between records $fin = 'simulate/gps.txt'; my ($then, $now); $then = $now = now(); my $irec = 0; #110107,000018,$GPRMC,000015,A,3000.3609,N,14455.5704,W,014.4,262.4,070111,012.8,E*66 while (1) { $irec = 0; open(F,"<$fin") or die; while () { chomp( $str = $_); print"$str\r\n"; ## PAUSE A FEW SECONDS sleep($update); } print"Starting over\n"; close F; }