GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
NMEA(3) User Contributed Perl Documentation NMEA(3)

GPS::NMEA - Perl interface to GPS equipment using the NMEA Protocol

  use GPS::NMEA;
  $gps = new GPS::NMEA(  'Port'      => '/dev/ttyS0',
                         'Baud'      => 9600,
                );

GPS::NMEA allows the connection and use of of a GPS receiver in perl scripts.

Note that latitudes and longitudes are in DMM format.

Get the position periodically:

    #!/usr/bin/perl
    use GPS::NMEA;
    
    my $gps = GPS::NMEA->new(Port => '/dev/cuaa0', # or COM5: or /dev/ttyS0
                             Baud => 4800);
    while(1) {
        my($ns,$lat,$ew,$lon) = $gps->get_position;
        print "($ns,$lat,$ew,$lon)\n";
    }

Get the internal NMEA dump:

    #!/usr/bin/perl
    use GPS::NMEA;
    use Data::Dumper;
    
    my $gps = GPS::NMEA->new(Port => '/dev/cuaa0', # or COM5: or /dev/ttyS0
                             Baud => 4800);
    while(1) {
        $gps->parse;
    
        # Dump internal NMEA data:
        $gps->nmea_data_dump;
    
        # Alternative to look at the internal NMEA data:
        require Data::Dumper;
        print Data::Dumper->new([$gps->{NMEADATA}],[])->Indent(1)->Useqq(1)->Dump;
    }
    __END__

Joao Pedro B Gonçalves , joaop@iscsp.utl.pt

Hey! The above document had some coding errors, which are explained below:
Around line 159:
You forgot a '=back' before '=head1'
Around line 204:
Non-ASCII character seen before =encoding in 'Gonçalves'. Assuming CP1252
2009-03-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.