Documentation
¶
Index ¶
- Constants
- func FormatDMS(l float64) string
- func FormatGPS(l float64) string
- func ParseDMS(s string) (float64, error)
- func ParseDecimal(s string) (float64, error)
- func ParseGPS(s string) (float64, error)
- func ParseLatLong(s string) (float64, error)
- type BaseSentence
- type Date
- type GLGSV
- type GLGSVInfo
- type GNGGA
- type GNRMC
- type GPGGA
- type GPGLL
- type GPGSA
- type GPGSV
- type GPGSVInfo
- type GPRMC
- type GPVTG
- type GPZDA
- type PGRME
- type Sentence
- type Time
Constants ¶
const ( // PrefixGPGGA prefix PrefixGPGGA = "GPGGA" // Invalid fix quality. Invalid = "0" // GPS fix quality GPS = "1" // DGPS fix quality DGPS = "2" // PPS fix PPS = "3" // RTK real time kinematic fix RTK = "4" // FRTK float RTK fix FRTK = "5" )
const ( // PrefixGPGLL prefix for GPGLL sentence type PrefixGPGLL = "GPGLL" // ValidGLL character ValidGLL = "A" // InvalidGLL character InvalidGLL = "V" )
const ( // PrefixGPGSA prefix of GPGSA sentence type PrefixGPGSA = "GPGSA" // Auto - Field 1, auto or manual fix. Auto = "A" // Manual - Field 1, auto or manual fix. Manual = "M" // FixNone - Field 2, fix type. FixNone = "1" // Fix2D - Field 2, fix type. Fix2D = "2" // Fix3D - Field 2, fix type. Fix3D = "3" )
const ( // PrefixGPRMC prefix of GPRMC sentence type PrefixGPRMC = "GPRMC" // ValidRMC character ValidRMC = "A" // InvalidRMC character InvalidRMC = "V" )
const ( // PrefixPGRME prefix for PGRME sentence type PrefixPGRME = "PGRME" // ErrorUnit must be meters (M) ErrorUnit = "M" )
const ( // SentenceStart is the token to indicate the start of a sentence. SentenceStart = "$" // FieldSep is the token to delimit fields of a sentence. FieldSep = "," // ChecksumSep is the token to delimit the checksum of a sentence. ChecksumSep = "*" )
const ( // Degrees value Degrees = '\u00B0' // Minutes value Minutes = '\'' // Seconds value Seconds = '"' // Point value Point = '.' // North value North = "N" // South value South = "S" // East value East = "E" // West value West = "W" )
const (
// PrefixGLGSV prefix
PrefixGLGSV = "GLGSV"
)
const (
// PrefixGNGGA prefix
PrefixGNGGA = "GNGGA"
)
const (
// PrefixGNRMC prefix of GNRMC sentence type
PrefixGNRMC = "GNRMC"
)
const (
// PrefixGPGSV prefix
PrefixGPGSV = "GPGSV"
)
const (
// PrefixGPVTG prefix
PrefixGPVTG = "GPVTG"
)
const (
// PrefixGPZDA prefix
PrefixGPZDA = "GPZDA"
)
Variables ¶
This section is empty.
Functions ¶
func ParseDecimal ¶
ParseDecimal parses a decimal format coordinate. e.g: 151.196019
func ParseLatLong ¶
ParseLatLong parses the supplied string into the LatLong.
Supported formats are: - DMS (e.g. 33° 23' 22") - Decimal (e.g. 33.23454) - GPS (e.g 15113.4322S)
Types ¶
type BaseSentence ¶
type BaseSentence struct {
Type string // The sentence type (e.g $GPGSA)
Fields []string // Array of fields
Checksum string // The Checksum
Raw string // The raw NMEA sentence received
}
BaseSentence contains the information about the NMEA sentence
func (BaseSentence) Prefix ¶
func (s BaseSentence) Prefix() string
Prefix returns the type of the message
func (BaseSentence) String ¶
func (s BaseSentence) String() string
String formats the sentence into a string
type GLGSV ¶
type GLGSV struct {
BaseSentence
TotalMessages int64 // Total number of messages of this type in this cycle
MessageNumber int64 // Message number
NumberSVsInView int64 // Total number of SVs in view
Info []GLGSVInfo // visible satellite info (0-4 of these)
}
GLGSV represents the GPS Satellites in view http://aprs.gids.nl/nmea/#glgsv
type GLGSVInfo ¶
type GLGSVInfo struct {
SVPRNNumber int64 // SV PRN number, pseudo-random noise or gold code
Elevation int64 // Elevation in degrees, 90 maximum
Azimuth int64 // Azimuth, degrees from true north, 000 to 359
SNR int64 // SNR, 00-99 dB (null when not tracking)
}
GLGSVInfo represents information about a visible satellite
type GNGGA ¶
type GNGGA struct {
BaseSentence
Time Time // Time of fix.
Latitude float64 // Latitude.
Longitude float64 // Longitude.
FixQuality string // Quality of fix.
NumSatellites int64 // Number of satellites in use.
HDOP float64 // Horizontal dilution of precision.
Altitude float64 // Altitude.
Separation float64 // Geoidal separation
DGPSAge string // Age of differential GPD data.
DGPSId string // DGPS reference station ID.
}
GNGGA is the Time, position, and fix related data of the receiver.
type GNRMC ¶
type GNRMC struct {
BaseSentence
Time Time // Time Stamp
Validity string // validity - A-ok, V-invalid
Latitude float64 // Latitude
Longitude float64 // Longitude
Speed float64 // Speed in knots
Course float64 // True course
Date Date // Date
Variation float64 // Magnetic variation
}
GNRMC is the Recommended Minimum Specific GNSS data. http://aprs.gids.nl/nmea/#rmc
type GPGGA ¶
type GPGGA struct {
BaseSentence
Time Time // Time of fix.
Latitude float64 // Latitude.
Longitude float64 // Longitude.
FixQuality string // Quality of fix.
NumSatellites int64 // Number of satellites in use.
HDOP float64 // Horizontal dilution of precision.
Altitude float64 // Altitude.
Separation float64 // Geoidal separation
DGPSAge string // Age of differential GPD data.
DGPSId string // DGPS reference station ID.
}
GPGGA represents fix data. http://aprs.gids.nl/nmea/#gga
type GPGLL ¶
type GPGLL struct {
BaseSentence
Latitude float64 // Latitude
Longitude float64 // Longitude
Time Time // Time Stamp
Validity string // validity - A-valid
}
GPGLL is Geographic Position, Latitude / Longitude and time. http://aprs.gids.nl/nmea/#gll
type GPGSA ¶
type GPGSA struct {
BaseSentence
Mode string // The selection mode.
FixType string // The fix type.
SV []string // List of satellite PRNs used for this fix.
PDOP float64 // Dilution of precision.
HDOP float64 // Horizontal dilution of precision.
VDOP float64 // Vertical dilution of precision.
}
GPGSA represents overview satellite data. http://aprs.gids.nl/nmea/#gsa
type GPGSV ¶
type GPGSV struct {
BaseSentence
TotalMessages int64 // Total number of messages of this type in this cycle
MessageNumber int64 // Message number
NumberSVsInView int64 // Total number of SVs in view
Info []GPGSVInfo // visible satellite info (0-4 of these)
}
GPGSV represents the GPS Satellites in view http://aprs.gids.nl/nmea/#gpgsv
type GPGSVInfo ¶
type GPGSVInfo struct {
SVPRNNumber int64 // SV PRN number, pseudo-random noise or gold code
Elevation int64 // Elevation in degrees, 90 maximum
Azimuth int64 // Azimuth, degrees from true north, 000 to 359
SNR int64 // SNR, 00-99 dB (null when not tracking)
}
GPGSVInfo represents information about a visible satellite
type GPRMC ¶
type GPRMC struct {
BaseSentence
Time Time // Time Stamp
Validity string // validity - A-ok, V-invalid
Latitude float64 // Latitude
Longitude float64 // Longitude
Speed float64 // Speed in knots
Course float64 // True course
Date Date // Date
Variation float64 // Magnetic variation
}
GPRMC is the Recommended Minimum Specific GNSS data. http://aprs.gids.nl/nmea/#rmc
type GPVTG ¶
type GPVTG struct {
BaseSentence
TrueTrack float64
MagneticTrack float64
GroundSpeedKnots float64
GroundSpeedKPH float64
}
GPVTG represents track & speed data. http://aprs.gids.nl/nmea/#vtg
type GPZDA ¶
type GPZDA struct {
BaseSentence
Time Time
Day int64
Month int64
Year int64
OffsetHours int64 // Local time zone offset from GMT, hours
OffsetMinutes int64 // Local time zone offset from GMT, minutes
}
GPZDA represents date & time data. http://aprs.gids.nl/nmea/#zda
type PGRME ¶
type PGRME struct {
BaseSentence
Horizontal float64 // Estimated horizontal position error (HPE) in metres
Vertical float64 // Estimated vertical position error (VPE) in metres
Spherical float64 // Overall spherical equivalent position error in meters
}
PGRME is Estimated Position Error (Garmin proprietary sentence) http://aprs.gids.nl/nmea/#rme