# README
go-nmea

This is a NMEA library for the Go programming language (http://golang.org).
Installing
Using go get
go get github.com/adrianmo/go-nmea
After this command go-nmea is ready to use. Its source will be in:
$GOPATH/src/github.com/adrianmo/go-nmea
Supported sentences
At this moment, this library supports the following sentence types:
- RMC - Recommended Minimum Specific GPS/Transit data
- GGA - GPS Positioning System Fix Data
- GSA - GPS DOP and active satellites
- GSV - GPS Satellites in view
- GLL - Geographic Position, Latitude / Longitude and time
- VTG - Track Made Good and Ground Speed
- ZDA - Date & time data
- HDT - Actual vessel heading in degrees True
- GNS - Combined GPS fix for GPS, Glonass, Galileo, and BeiDou
- PGRME - Estimated Position Error (Garmin proprietary sentence)
- THS - Actual vessel heading in degrees True and status
- VDM/VDO - Encapsulated binary payload
- WPL - Waypoint location
- RTE - Route
Example
package main
import (
"fmt"
"log"
"github.com/adrianmo/go-nmea"
)
func main() {
sentence := "$GPRMC,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W*70"
s, err := nmea.Parse(sentence)
if err != nil {
log.Fatal(err)
}
if s.DataType() == nmea.TypeRMC {
m := s.(nmea.RMC)
fmt.Printf("Raw sentence: %v\n", m)
fmt.Printf("Time: %s\n", m.Time)
fmt.Printf("Validity: %s\n", m.Validity)
fmt.Printf("Latitude GPS: %s\n", nmea.FormatGPS(m.Latitude))
fmt.Printf("Latitude DMS: %s\n", nmea.FormatDMS(m.Latitude))
fmt.Printf("Longitude GPS: %s\n", nmea.FormatGPS(m.Longitude))
fmt.Printf("Longitude DMS: %s\n", nmea.FormatDMS(m.Longitude))
fmt.Printf("Speed: %f\n", m.Speed)
fmt.Printf("Course: %f\n", m.Course)
fmt.Printf("Date: %s\n", m.Date)
fmt.Printf("Variation: %f\n", m.Variation)
}
}
Output:
$ go run main/main.go
Raw sentence: $GPRMC,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W*70
Time: 22:05:16.0000
Validity: A
Latitude GPS: 5133.8200
Latitude DMS: 51° 33' 49.200000"
Longitude GPS: 042.2400
Longitude DMS: 0° 42' 14.400000"
Speed: 173.800000
Course: 231.800000
Date: 13/06/94
Variation: -4.200000
Contributions
Please, feel free to implement support for new sentences, fix bugs, refactor code, etc. and send a pull-request to update the library.
# Functions
FormatDMS returns the degrees, minutes, seconds format for the given LatLong.
FormatGPS formats a GPS/NMEA coordinate.
NewParser constructor.
Parse parses the given string into the correct sentence type.
ParseDate field ddmmyy format.
ParseDecimal parses a decimal format coordinate.
ParseDMS parses a coordinate in degrees, minutes, seconds.
ParseGPS parses a GPS/NMEA coordinate.
ParseLatLong parses the supplied string into the LatLong.
parseSentence parses a raw message into it's fields.
ParseTime parses wall clock time.
# Constants
ActiveRoute active route.
Auto - Field 1, auto or manual fix.
AutonomousGNS Character.
AutonomousTHS autonomous ths heading.
ChecksumSep is the token to delimit the checksum of a sentence.
Degrees value.
DGPS fix quality.
DifferentialGNS Character.
East value.
ErrorUnit must be meters (M).
EstimatedGNS Fix Character.
EstimatedTHS estimated (dead reckoning) THS heading.
FieldSep is the token to delimit fields of a sentence.
Fix2D - Field 2, fix type.
Fix3D - Field 2, fix type.
FixNone - Field 2, fix type.
FloatRTKGNS RealTime Kinematic Character.
FRTK float RTK fix.
GPS fix quality.
Invalid fix quality.
InvalidGLL character.
InvalidRMC character.
InvalidTHS not valid THS heading (or standby).
Manual - Field 1, auto or manual fix.
ManualGNS Fix Character.
ManualTHS manual input THS heading.
Minutes value.
NoFixGNS Character.
North value.
Point value.
PPS fix.
PreciseGNS Character.
PrefixGLGSV prefix
Deprecated: Use TypeGSV instead.
PrefixGNGGA prefix
Deprecated: Use TypeGGA instead.
PrefixGNGNS prefix
Deprecated: Use TypeGNS instead.
PrefixGNRMC prefix of GNRMC sentence type
Deprecated: Use TypeRMC instead.
PrefixGPGGA prefix
Deprecated: Use TypeGGA instead.
PrefixGPGLL prefix for GPGLL sentence type
Deprecated: Use TypeGLL instead.
PrefixGPGSA prefix of GPGSA sentence type
Deprecated: Use TypeGSA instead.
PrefixGPGSV prefix
Deprecated: Use TypeGSV instead.
PrefixGPHDT prefix of GPHDT sentence type
Deprecated: Use TypeHDT instead.
PrefixGPRMC prefix of GPRMC sentence type
Deprecated: Use TypeRMC instead.
PrefixGPVTG prefix
Deprecated: Use TypeVTG instead.
PrefixGPZDA prefix
Deprecated: Use TypeZDA instead.
PrefixPGRME prefix for PGRME sentence type
Deprecated: Use TypePGRME instead.
RealTimeKinematicGNS Character.
RTK real time kinematic fix.
Seconds value.
SentenceStart is the token to indicate the start of a sentence.
SentenceStartEncapsulated is the token to indicate the start of encapsulated data.
SimulatorGNS Character.
SimulatorTHS simulated THS heading.
South value.
TypeALC type for ALC sentences.
TypeALF type for ALF sentences.
TypeALR type for ALR sentences.
TypeARC type for ARC sentences.
TypeDBK type for DBK sentences.
TypeDBS type for DBS sentences.
TypeDBT type for DBT sentences.
TypeDPT type for DPT sentences.
TypeGGA type for GGA sentences.
TypeGLL type for GLL sentences.
TypeGNS type for GNS sentences.
TypeGSA type for GSA sentences.
TypeGSV type for GSV sentences.
TypeHBT type for HBT sentences.
TypeHDG type for HDG sentences.
TypeHDT type for HDT sentences.
TypePGRME type for PGRME sentences.
TypeRMC type for RMC sentences.
TypeROT type for ROT sentences.
TypeRTE type for RTE sentences.
TypeTHS type for THS sentences.
TypeVDM type for VDM sentences.
TypeVDO type for VDO sentences.
TypeVHW type for VHW sentences.
TypeVTG type for VTG sentences.
TypeWPL type for WPL sentences.
TypeZDA type for ZDA sentences.
ValidGLL character.
ValidRMC character.
WaypointList list containing waypoints.
West value.
# Structs
ALC cyclic alert list.
No description provided by the author
ALF alert sentence http://aprs.gids.nl/nmea/#hdt.
ALR set alarm state http://aprs.gids.nl/nmea/#hdt.
ARC alarm command refused http://aprs.gids.nl/nmea/#ARC.
BaseSentence contains the information about the NMEA sentence.
Date type.
DBK depth below keel http://aprs.gids.nl/nmea/#DBK.
DBS depth below keel http://aprs.gids.nl/nmea/#DBS.
DBT depth below keel http://aprs.gids.nl/nmea/#DBT.
DPT depth below keel http://aprs.gids.nl/nmea/#DPT.
GGA is the Time, position, and fix related data of the receiver.
GLL is Geographic Position, Latitude / Longitude and time.
GNS is standard GNSS sentance that combined multiple constellations.
GSA represents overview satellite data.
GSV represents the GPS Satellites in view http://aprs.gids.nl/nmea/#glgsv.
GSVInfo represents information about a visible satellite.
HBT heartheat supervision sentence http://aprs.gids.nl/nmea/#HBT.
HDG is the Actual vessel heading in degrees True.
HDT is the Actual vessel heading in degrees True.
Parser provides a simple way of accessing and parsing sentence fields.
PGRME is Estimated Position Error (Garmin proprietary sentence) http://aprs.gids.nl/nmea/#rme.
RMC is the Recommended Minimum Specific GNSS data.
ROT rate of turn http://aprs.gids.nl/nmea/#hdt.
RTE is a route of waypoints.
THS is the Actual vessel heading in degrees True with status.
Time type.
VDMVDO is a format used to encapsulate generic binary payloads.
VHW is the Actual vessel heading in degrees True.
VTG represents track & speed data.
WPL contains information about a waypoint location.
ZDA represents date & time data.
# Interfaces
Sentence interface for all NMEA sentence.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author