Documentation ¶
Index ¶
- Constants
- func Checksum(s string) string
- func FormatDMS(l Float64) string
- func FormatGPS(l Float64) string
- func LatDir(l float64) string
- func LonDir(l float64) string
- func MustRegisterParser(sentenceType string, parser ParserFunc)
- func RegisterParser(sentenceType string, parser ParserFunc) error
- type ALR
- type Alarm
- type BaseSentence
- type CallSign
- type DBS
- type DBT
- type DPT
- type Date
- type DateTime
- type DepthBelowKeel
- type DepthBelowSurface
- type DepthBelowTransducer
- type Destination
- type DewPointTemperature
- type ENINumber
- type ETA
- type FixQuality
- type FixType
- type Float64
- type GGA
- type GLL
- type GNS
- type GSA
- type GST
- type GSV
- type GSVInfo
- type HDT
- type HEV
- type Heave
- type Humidity
- type IMONumber
- type Int64
- type MDA
- func (s MDA) GetDewPointTemperature() (float64, error)
- func (s MDA) GetHumidity() (float64, error)
- func (s MDA) GetMagneticWindDirection() (float64, error)
- func (s MDA) GetOutsidePressure() (float64, error)
- func (s MDA) GetOutsideTemperature() (float64, error)
- func (s MDA) GetTrueWindDirection() (float64, error)
- func (s MDA) GetWaterTemperature() (float64, error)
- func (s MDA) GetWindSpeed() (float64, error)
- type MMSI
- type MTK
- type MWD
- type MWV
- type MagneticCourseOverGround
- type MagneticHeading
- type MagneticVariation
- type MagneticWindDirection
- type NavigationStatus
- type NumberOfSatellites
- type OutsideTemperature
- type PGRME
- type Parser
- func (p *Parser) AssertType(typ string)
- func (p *Parser) Date(i int, context string) Date
- func (p *Parser) EnumChars(i int, context string, options ...string) StringList
- func (p *Parser) EnumString(i int, context string, options ...string) String
- func (p *Parser) Err() error
- func (p *Parser) Float64(i int, context string) Float64
- func (p *Parser) Int64(i int, context string) Int64
- func (p *Parser) LatLong(i, j int, context string) Float64
- func (p *Parser) ListString(from int, context string) StringList
- func (p *Parser) SetErr(context, value string)
- func (p *Parser) SixBitASCIIArmour(i int, fillBits int, context string) []byte
- func (p *Parser) String(i int, context string) String
- func (p *Parser) Time(i int, context string) Time
- type ParserFunc
- type Position2D
- type Position3D
- type RMC
- type ROT
- type RSA
- type RTE
- type RateOfTurn
- type RelativeWindDirection
- type RudderAngle
- type Sentence
- type SpeedOverGround
- type SpeedThroughWater
- type String
- type StringList
- type THS
- type TagBlock
- type Time
- type TrueCourseOverGround
- type TrueHeading
- type TrueWindDirection
- type VDMVDO
- func (s VDMVDO) GetCallSign() (string, error)
- func (s VDMVDO) GetDestination() (string, error)
- func (s VDMVDO) GetENINumber() (string, error)
- func (s VDMVDO) GetETA() (time.Time, error)
- func (s VDMVDO) GetIMONumber() (string, error)
- func (s VDMVDO) GetMMSI() (string, error)
- func (s VDMVDO) GetNavigationStatus() (string, error)
- func (s VDMVDO) GetPosition2D() (float64, float64, error)
- func (s VDMVDO) GetRateOfTurn() (float64, error)
- func (s VDMVDO) GetSpeedOverGround() (float64, error)
- func (s VDMVDO) GetTrueCourseOverGround() (float64, error)
- func (s VDMVDO) GetTrueHeading() (float64, error)
- func (s VDMVDO) GetVesselBeam() (float64, error)
- func (s VDMVDO) GetVesselLength() (float64, error)
- func (s VDMVDO) GetVesselName() (string, error)
- func (s VDMVDO) GetVesselType() (string, error)
- type VHW
- type VTG
- type VWR
- type VesselBeam
- type VesselLength
- type VesselName
- type VesselType
- type WPL
- type WaterTemperature
- type WindSpeed
- type ZDA
Constants ¶
const ( // TypeALR type for ALR sentences TypeALR = "ALR" // Active alarm ActiveALR = "A" // Inactive alarm InactiveALR = "V" // Active alarm AcknowledgedALR = "A" // Inactive alarm UnacknowledgedALR = "V" )
const ( // TypeGGA type for GGA sentences TypeGGA = "GGA" // 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" // EST estimated fix. EST = "6" )
const ( // TypeGLL type for GLL sentences TypeGLL = "GLL" // ValidGLL character ValidGLL = "A" // InvalidGLL character InvalidGLL = "V" )
const ( // TypeGNS type for GNS sentences TypeGNS = "GNS" // NoFixGNS Character NoFixGNS = "N" // AutonomousGNS Character AutonomousGNS = "A" // DifferentialGNS Character DifferentialGNS = "D" // PreciseGNS Character PreciseGNS = "P" // RealTimeKinematicGNS Character RealTimeKinematicGNS = "R" // FloatRTKGNS RealTime Kinematic Character FloatRTKGNS = "F" // EstimatedGNS Fix Character EstimatedGNS = "E" // ManualGNS Fix Character ManualGNS = "M" // SimulatorGNS Character SimulatorGNS = "S" )
const ( // TypeGSA type for GSA sentences TypeGSA = "GSA" // 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 ( // TypeMWV type for MWV sentences TypeMWV = "MWV" ReferenceRelative = "R" ReferenceTrue = "T" WindSpeedUnitKPH = "K" WindSpeedUnitKnots = "N" WindSpeedUnitMPS = "M" WindSpeedUnitMPH = "S" ValidMWV = "A" InvalidMWV = "V" )
const ( // TypePGRME type for PGRME sentences TypePGRME = "GRME" // ErrorUnit must be meters (M) ErrorUnit = "M" )
const ( // TypeRMC type for RMC sentences TypeRMC = "RMC" // ValidRMC character ValidRMC = "A" // InvalidRMC character InvalidRMC = "V" )
const ( // TypeROT type for ROT sentences TypeROT = "ROT" ValidROT = "A" InvalidROT = "V" )
const ( // TypeRSA type for RSA sentences TypeRSA = "RSA" ValidRSA = "A" InvalidRSA = "V" )
const ( // TypeRTE type for RTE sentences TypeRTE = "RTE" // ActiveRoute active route ActiveRoute = "c" // WaypointList list containing waypoints WaypointList = "w" )
const ( // SentenceStart is the token to indicate the start of a sentence. SentenceStart = "$" // SentenceStartEncapsulated is the token to indicate the start of encapsulated data. SentenceStartEncapsulated = "!" // FieldSep is the token to delimit fields of a sentence. FieldSep = "," // ChecksumSep is the token to delimit the checksum of a sentence. ChecksumSep = "*" )
const ( // TypeTHS type for THS sentences TypeTHS = "THS" // AutonomousTHS autonomous ths heading AutonomousTHS = "A" // EstimatedTHS estimated (dead reckoning) THS heading EstimatedTHS = "E" // ManualTHS manual input THS heading ManualTHS = "M" // SimulatorTHS simulated THS heading SimulatorTHS = "S" // InvalidTHS not valid THS heading (or standby) InvalidTHS = "V" )
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 ( // TypeVDM type for VDM sentences TypeVDM = "VDM" // TypeVDO type for VDO sentences TypeVDO = "VDO" )
const ( // TypeVWR type for VWR sentences TypeVWR = "VWR" LeftOfBow = "L" RightOfBow = "R" )
const (
// TypeDBS type for DBS sentences
TypeDBS = "DBS"
)
const (
// TypeDBT type for DBT sentences
TypeDBT = "DBT"
)
const (
// TypeDPT type for DPT sentences
TypeDPT = "DPT"
)
const (
// TypeGST type for GST sentences
TypeGST = "GST"
)
const (
// TypeGSV type for GSV sentences
TypeGSV = "GSV"
)
const (
// TypeHDT type for HDT sentences
TypeHDT = "HDT"
)
const (
// TypeHEV type for HEV sentences
TypeHEV = "HEV"
)
const (
// TypeMDA type for MDA sentences
TypeMDA = "MDA"
)
const (
// TypeMTK type for PMTK sentences
TypeMTK = "PMTK"
)
const (
// TypeMWD type for MWD sentences
TypeMWD = "MWD"
)
const (
// TypeVHW type for VHW sentences
TypeVHW = "VHW"
)
const (
// TypeVTG type for VTG sentences
TypeVTG = "VTG"
)
const (
// TypeWPL type for WPL sentences
TypeWPL = "WPL"
)
const (
// TypeZDA type for ZDA sentences
TypeZDA = "ZDA"
)
Variables ¶
This section is empty.
Functions ¶
func Checksum ¶ added in v1.4.0
Checksum xor all the bytes in a string an return it as an uppercase hex string
func MustRegisterParser ¶ added in v1.4.0
func MustRegisterParser(sentenceType string, parser ParserFunc)
MustRegisterParser register a custom parser or panic
func RegisterParser ¶ added in v1.4.0
func RegisterParser(sentenceType string, parser ParserFunc) error
RegisterParser register a custom parser
Types ¶
type ALR ¶ added in v1.5.0
type ALR struct { BaseSentence Time Time Identifier String Condition String State String Description String }
ZDA represents date & time data. http://aprs.gids.nl/nmea/#zda
func (ALR) GetDescription ¶ added in v1.5.0
func (ALR) GetIdentifier ¶ added in v1.5.0
func (ALR) IsUnacknowledged ¶ added in v1.5.0
type Alarm ¶ added in v1.5.0
type Alarm interface { IsActive() (bool, error) IsUnacknowledged() (bool, error) GetDescription() (string, error) }
Alarm retrieves alarm information from the sentence
type BaseSentence ¶
type BaseSentence struct { Talker string // The talker id (e.g GP) Type string // The data type (e.g GSA) Fields []string // Array of fields Checksum string // The Checksum Raw string // The raw NMEA sentence received TagBlock TagBlock // NMEA tagblock }
BaseSentence contains the information about the NMEA sentence
func (BaseSentence) DataType ¶ added in v1.4.0
func (s BaseSentence) DataType() string
DataType returns the type of the message
func (BaseSentence) Prefix ¶
func (s BaseSentence) Prefix() string
Prefix returns the talker and type of message
func (BaseSentence) String ¶
func (s BaseSentence) String() string
String formats the sentence into a string
func (BaseSentence) TalkerID ¶ added in v1.4.0
func (s BaseSentence) TalkerID() string
TalkerID returns the talker of the message
type DBS ¶ added in v1.4.0
type DBS struct { BaseSentence DepthFeet Float64 DepthMeters Float64 DepthFathoms Float64 }
DBS - Depth Below Surface https://gpsd.gitlab.io/gpsd/NMEA.html#_dbs_depth_below_surface
func (DBS) GetDepthBelowSurface ¶ added in v1.4.0
GetDepthBelowSurface retrieves the depth below surface from the sentence
type DBT ¶ added in v1.4.0
type DBT struct { BaseSentence DepthFeet Float64 DepthMeters Float64 DepthFathoms Float64 }
DBT - Depth below transducer https://gpsd.gitlab.io/gpsd/NMEA.html#_dbt_depth_below_transducer
func (DBT) GetDepthBelowTransducer ¶ added in v1.4.0
GetDepthBelowTransducer retrieves the depth below the transducer from the sentence
type DPT ¶ added in v1.4.0
type DPT struct { BaseSentence Depth Float64 Offset Float64 RangeScale Float64 }
DPT - Depth of Water https://gpsd.gitlab.io/gpsd/NMEA.html#_dpt_depth_of_water
func (DPT) GetDepthBelowKeel ¶ added in v1.4.0
GetDepthBelowKeel retrieves the depth below the keel from the sentence
func (DPT) GetDepthBelowSurface ¶ added in v1.4.0
GetDepthBelowSurface retrieves the depth below surface from the sentence
func (DPT) GetDepthBelowTransducer ¶ added in v1.4.0
GetDepthBelowTransducer retrieves the depth below the keel from the sentence
type Date ¶
Date type
func NewInvalidDate ¶ added in v1.4.0
NewInvalidDate creates an invalid Date
type DepthBelowKeel ¶ added in v1.4.0
DepthBelowKeel retrieves the depth below keel from the sentence
type DepthBelowSurface ¶ added in v1.4.0
DepthBelowSurface retrieves the depth below surface from the sentence
type DepthBelowTransducer ¶ added in v1.4.0
DepthBelowTransducer retrieves the depth below the transducer from the sentence
type Destination ¶ added in v1.4.0
Destination retrieves the destination of the vessel from the sentence
type DewPointTemperature ¶ added in v1.4.0
DewPointTemperature retrieves the dew point temperature from the sentence
type ENINumber ¶ added in v1.4.0
type ENINumber interface { // https://en.wikipedia.org/wiki/ENI_number GetENINumber() (string, error) }
ENINumber retrieves the ENI number of the vessel from the sentence
type FixQuality ¶ added in v1.4.0
FixQuality retrieves the fix quality from the sentence
type Float64 ¶ added in v1.4.0
Float64 type
func NewFloat64 ¶ added in v1.4.0
NewFloat64 creates a valid Float64
func NewInvalidFloat64 ¶ added in v1.4.0
NewInvalidFloat64 creates an invalid Float64
func ParseDecimal ¶
ParseDecimal parses a decimal format coordinate. e.g: 151.196019
func ParseFloat64 ¶ added in v1.4.0
ParseFloat64 parses a string and creates a Float64, if the string can't be parsed an invalid Float64 is returned
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)
type GGA ¶ added in v1.4.0
type GGA 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. }
GGA is the Time, position, and fix related data of the receiver.
func (GGA) GetFixQuality ¶ added in v1.4.0
GetFixQuality retrieves the fix quality from the sentence
func (GGA) GetNumberOfSatellites ¶ added in v1.4.0
GetNumberOfSatellites retrieves the number of satellites from the sentence
type GLL ¶ added in v1.4.0
type GLL struct { BaseSentence Latitude Float64 // Latitude Longitude Float64 // Longitude Time Time // Time Stamp Validity String // validity - A-valid }
GLL is Geographic Position, Latitude / Longitude and time. http://aprs.gids.nl/nmea/#gll
type GNS ¶ added in v1.4.0
type GNS struct { BaseSentence Time Time Latitude Float64 Longitude Float64 Mode StringList SVs Int64 HDOP Float64 Altitude Float64 Separation Float64 Age Float64 Station Int64 }
GNS is standard GNSS sentance that combined multiple constellations
type GSA ¶ added in v1.4.0
type GSA 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. }
GSA represents overview satellite data. http://aprs.gids.nl/nmea/#gsa
func (GSA) GetFixType ¶ added in v1.4.0
GetFixType retrieves the fix type from the sentence
func (GSA) GetNumberOfSatellites ¶ added in v1.4.0
GetNumberOfSatellites retrieves the number of satellites from the sentence
type GST ¶ added in v1.4.0
type GST struct { BaseSentence Time Time RMSPseudorangeResiduals Float64 ErrorEllipseSemiMajorAxis1SigmaError Float64 ErrorEllipseSemiMinorAxis1SigmaError Float64 ErrorEllipseOrientation Float64 Latitude1SigmaError Float64 Longitude1SigmaError Float64 Height1SigmaError Float64 }
GST - Position error statistics
type GSV ¶ added in v1.4.0
type GSV 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 []GSVInfo // visible satellite info (0-4 of these) }
GSV represents the GPS Satellites in view http://aprs.gids.nl/nmea/#glgsv
func (GSV) GetNumberOfSatellites ¶ added in v1.4.0
GetNumberOfSatellites retrieves the number of satellites from the sentence
type GSVInfo ¶ added in v1.4.0
type GSVInfo 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) }
GSVInfo represents information about a visible satellite
type HDT ¶ added in v1.4.0
type HDT struct { BaseSentence Heading Float64 // Heading in degrees True bool // Heading is relative to true north }
HDT is the Actual vessel heading in degrees True. http://aprs.gids.nl/nmea/#hdt
func (HDT) GetTrueHeading ¶ added in v1.4.0
GetTrueHeading retrieves the true heading from the sentence
type HEV ¶ added in v1.4.0
type HEV struct { BaseSentence Heave Float64 // Heave in meters }
HEV - Heave
type Int64 ¶ added in v1.4.0
Int64 type
func NewInvalidInt64 ¶ added in v1.4.0
NewInvalidInt64 creates an invalid Int64
func ParseInt64 ¶ added in v1.4.0
ParseInt64 parses a string and creates a Int64, if the string can't be parsed an invalid Int64 is returned
type MDA ¶ added in v1.4.0
type MDA struct { BaseSentence BarometricPressureInInchesOfMercury Float64 BarometricPressureInBar Float64 AirTemperature Float64 WaterTemperature Float64 RelativeHumidity Float64 DewPoint Float64 WindDirectionTrue Float64 WindDirectionMagnetic Float64 WindSpeedInKnots Float64 WindSpeedInMetersPerSecond Float64 }
MDA - Meteorological Composite
func (MDA) GetDewPointTemperature ¶ added in v1.4.0
GetDewPointTemperature retrieves the dew point temperature from the sentence
func (MDA) GetHumidity ¶ added in v1.4.0
GetHumidity retrieves the relative humidity from the sentence
func (MDA) GetMagneticWindDirection ¶ added in v1.4.0
GetMagneticWindDirection retrieves the true wind direction from the sentence
func (MDA) GetOutsidePressure ¶ added in v1.4.0
GetOutsidePressure retrieves the outside pressure from the sentence
func (MDA) GetOutsideTemperature ¶ added in v1.4.0
GetOutsideTemperature retrieves the outside air temperature from the sentence
func (MDA) GetTrueWindDirection ¶ added in v1.4.0
GetTrueWindDirection retrieves the true wind direction from the sentence
func (MDA) GetWaterTemperature ¶ added in v1.4.0
GetWaterTemperature retrieves the outside air temperature from the sentence
func (MDA) GetWindSpeed ¶ added in v1.4.0
GetWindSpeed retrieves wind speed from the sentence
type MTK ¶ added in v1.4.0
type MTK struct { BaseSentence Cmd Int64 Flag Int64 }
MTK is the Time, position, and fix related data of the receiver.
type MWD ¶ added in v1.4.0
type MWD struct { BaseSentence WindDirectionTrue Float64 WindDirectionMagnetic Float64 WindSpeedInKnots Float64 WindSpeedInMetersPerSecond Float64 }
MWD - Wind Direction & Speed
func (MWD) GetMagneticWindDirection ¶ added in v1.4.0
GetMagneticWindDirection retrieves the true wind direction from the sentence
func (MWD) GetTrueWindDirection ¶ added in v1.4.0
GetTrueWindDirection retrieves the true wind direction from the sentence
func (MWD) GetWindSpeed ¶ added in v1.4.0
GetWindSpeed retrieves wind speed from the sentence
type MWV ¶ added in v1.4.0
type MWV struct { BaseSentence Angle Float64 Reference String WindSpeed Float64 WindSpeedUnit String Status String }
MWV - Wind Speed and Angle
func (MWV) GetRelativeWindDirection ¶ added in v1.4.0
GetRelativeWindDirection retrieves the relative wind direction from the sentence
func (MWV) GetTrueWindDirection ¶ added in v1.4.0
GetTrueWindDirection retrieves the true wind direction from the sentence
func (MWV) GetWindSpeed ¶ added in v1.4.0
GetWindSpeed retrieves wind speed from the sentence
type MagneticCourseOverGround ¶ added in v1.4.0
MagneticCourseOverGround retrieves the magnetic course over ground from the sentence
type MagneticHeading ¶ added in v1.4.0
MagneticHeading retrieves the magnetic heading from the sentence
type MagneticVariation ¶ added in v1.4.0
MagneticVariation retrieves the magnetic variation from the sentence
type MagneticWindDirection ¶ added in v1.4.0
MagneticWindDirection retrieves the magnetic wind direction from the sentence
type NavigationStatus ¶ added in v1.4.0
type NavigationStatus interface {
}NavigationStatus retrieves the navigation status from the sentence
type NumberOfSatellites ¶ added in v1.4.0
NumberOfSatellites retrieves the number of satellites from the sentence
type OutsideTemperature ¶ added in v1.4.0
OutsideTemperature retrieves the outside air temperature from the sentence
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
type Parser ¶ added in v1.4.0
type Parser struct { BaseSentence // contains filtered or unexported fields }
Parser provides a simple way of accessing and parsing sentence fields
func (*Parser) AssertType ¶ added in v1.4.0
AssertType makes sure the sentence's type matches the provided one.
func (*Parser) Date ¶ added in v1.4.0
Date returns the Date value at the specified index. If the value is empty, the Date is marked as invalid.
func (*Parser) EnumChars ¶ added in v1.4.0
func (p *Parser) EnumChars(i int, context string, options ...string) StringList
EnumChars returns an array of strings that are matched in the Mode field. It will only match the number of characters that are in the Mode field. If the value is empty, it will return an empty array
func (*Parser) EnumString ¶ added in v1.4.0
EnumString returns the field value at the specified index. An error occurs if the value is not one of the options and not empty.
func (*Parser) Err ¶ added in v1.4.0
Err returns the first error encountered during the parser's usage.
func (*Parser) Float64 ¶ added in v1.4.0
Float64 returns the float64 value at the specified index. If the value is an empty string, 0 is returned.
func (*Parser) Int64 ¶ added in v1.4.0
Int64 returns the int64 value at the specified index. If the value is an empty string, 0 is returned.
func (*Parser) LatLong ¶ added in v1.4.0
LatLong returns the coordinate value of the specified fields.
func (*Parser) ListString ¶ added in v1.4.0
func (p *Parser) ListString(from int, context string) StringList
ListString returns a list of all fields from the given start index. An error occurs if there is no fields after the given start index.
func (*Parser) SetErr ¶ added in v1.4.0
SetErr assigns an error. Calling this method has no effect if there is already an error.
func (*Parser) SixBitASCIIArmour ¶ added in v1.4.0
SixBitASCIIArmour decodes the 6-bit ascii armor used for VDM and VDO messages
type ParserFunc ¶ added in v1.4.0
type ParserFunc func(BaseSentence) (Sentence, error)
ParserFunc callback used to parse specific sentence variants
type Position2D ¶ added in v1.4.0
Position2D retrieves the 2D position from the sentence
type Position3D ¶ added in v1.4.0
Position3D retrieves the 3D position from the sentence
type RMC ¶ added in v1.4.0
type RMC 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 }
RMC is the Recommended Minimum Specific GNSS data. http://aprs.gids.nl/nmea/#rmc
func (RMC) GetDateTime ¶ added in v1.4.0
GetDateTime retrieves the date and time in RFC3339Nano format
func (RMC) GetMagneticVariation ¶ added in v1.4.0
GetMagneticVariation retrieves the magnetic variation from the sentence
func (RMC) GetPosition2D ¶ added in v1.4.0
GetPosition2D retrieves the latitude and longitude from the sentence
func (RMC) GetSpeedOverGround ¶ added in v1.4.0
GetSpeedOverGround retrieves the speed over ground from the sentence
func (RMC) GetTrueCourseOverGround ¶ added in v1.4.0
GetTrueCourseOverGround retrieves the true course over ground from the sentence
type ROT ¶ added in v1.4.0
type ROT struct { BaseSentence RateOfTurn Float64 // Rate of turn Status String }
ROT - Rate of turn
func (ROT) GetRateOfTurn ¶ added in v1.4.0
GetRateOfTurn retrieves the rate of turn from the sentence
type RSA ¶ added in v1.4.6
type RSA struct { BaseSentence RudderAngleStarboard Float64 StatusStarboard String RudderAnglePortside Float64 StatusPortside String }
RSA - Rudder Angle
func (RSA) GetRudderAngle ¶ added in v1.4.6
GetRudder retrieves the rudder angle of the single rudder from the sentence
func (RSA) GetRudderAnglePortside ¶ added in v1.4.6
GetRudderAnglePortside retrieves the rudder angle of the portside rudder from the sentence
func (RSA) GetRudderAngleStarboard ¶ added in v1.4.6
GetRudderAngleStarboard retrieves the rudder angle of the startboard rudder from the sentence
type RTE ¶ added in v1.4.0
type RTE struct { BaseSentence NumberOfSentences Int64 // Number of sentences in sequence SentenceNumber Int64 // Sentence number ActiveRouteOrWaypointList String // Current active route or waypoint list Name String // Name or number of active route Idents StringList // List of ident of waypoints }
RTE is a route of waypoints
type RateOfTurn ¶ added in v1.4.0
RateOfTurn retrieves the rate of turn from the sentence
type RelativeWindDirection ¶ added in v1.4.0
RelativeWindDirection retrieves the relative wind direction from the sentence
type RudderAngle ¶ added in v1.4.6
type RudderAngle interface { GetRudderAngle() (float64, error) GetRudderAngleStarboard() (float64, error) GetRudderAnglePortside() (float64, error) }
RudderAngle retrieves the rudder angle from the sentence
type SpeedOverGround ¶ added in v1.4.0
SpeedOverGround retrieves the speed over ground from the sentence
type SpeedThroughWater ¶ added in v1.4.0
SpeedThroughWater retrieves the speed through water from the sentence
type String ¶ added in v1.4.0
String type
func NewInvalidString ¶ added in v1.4.0
NewInvalidString creates an invalid String
type StringList ¶ added in v1.4.0
StringList type
func NewInvalidStringList ¶ added in v1.4.0
func NewInvalidStringList(reason string) StringList
NewInvalidStringList creates an invalid StringList
func NewStringList ¶ added in v1.4.0
func NewStringList(v []String) StringList
NewStringList creates a valid StringList
type THS ¶ added in v1.4.0
type THS struct { BaseSentence Heading Float64 // Heading in degrees Status String // Heading status }
THS is the Actual vessel heading in degrees True with status. http://www.nuovamarea.net/pytheas_9.html
func (THS) GetTrueHeading ¶ added in v1.4.0
GetTrueHeading retrieves the true heading from the sentence
type TagBlock ¶ added in v1.4.0
type TagBlock struct { Valid bool InvalidReason string Time Int64 // TypeUnixTime unix timestamp (unit is likely to be s, but might be ms, YMMV), parameter: -c RelativeTime Int64 // TypeRelativeTime relative time, parameter: -r Destination String // TypeDestinationID destination identification 15 char max, parameter: -d Grouping String // TypeGrouping sentence grouping, parameter: -g LineCount Int64 // TypeLineCount line count, parameter: -n Source String // TypeSourceID source identification 15 char max, parameter: -s Text String // TypeTextString valid character string, parameter -t }
TagBlock type
func NewInvalidTagblock ¶ added in v1.4.0
NewInvalidTagblock creates an invalid TagBlock
type Time ¶
Time type
func NewInvalidTime ¶ added in v1.4.0
NewInvalidTime creates an invalid Time
type TrueCourseOverGround ¶ added in v1.4.0
TrueCourseOverGround retrieves the true course over ground from the sentence
type TrueHeading ¶ added in v1.4.0
TrueHeading retrieves the true heading from the sentence
type TrueWindDirection ¶ added in v1.4.0
TrueWindDirection retrieves the true wind direction from the sentence
type VDMVDO ¶ added in v1.4.0
type VDMVDO struct { BaseSentence NumFragments Int64 FragmentNumber Int64 MessageID Int64 Channel String Payload []byte ais.Packet }
VDMVDO is a format used to encapsulate generic binary payloads. It is most commonly used with AIS data. https://gpsd.gitlab.io/gpsd/AIVDM.html
func (VDMVDO) GetCallSign ¶ added in v1.4.0
GetCallSign retrieves the call sign of the vessel from the sentence
func (VDMVDO) GetDestination ¶ added in v1.4.0
GetDestination retrieves the destination from the sentence
func (VDMVDO) GetENINumber ¶ added in v1.4.0
GetENINumber retrieves the ENI number of the vessel from the sentence
func (VDMVDO) GetETA ¶ added in v1.4.0
GetETA retrieves the estimated time of arrival from the sentence
func (VDMVDO) GetIMONumber ¶ added in v1.4.0
GetIMONumber retrieves the IMO number of the vessel from the sentence
func (VDMVDO) GetNavigationStatus ¶ added in v1.4.0
GetNavigationStatus retrieves the navigation status from the sentence
func (VDMVDO) GetPosition2D ¶ added in v1.4.0
GetPosition2D retrieves the 2D position from the sentence
func (VDMVDO) GetRateOfTurn ¶ added in v1.4.0
GetRateOfTurn retrieves the rate of turn from the sentence
func (VDMVDO) GetSpeedOverGround ¶ added in v1.4.0
GetSpeedOverGround retrieves the speed over ground from the sentence
func (VDMVDO) GetTrueCourseOverGround ¶ added in v1.4.0
GetTrueCourseOverGround retrieves the true course over ground from the sentence
func (VDMVDO) GetTrueHeading ¶ added in v1.4.0
GetTrueHeading retrieves the true heading from the sentence
func (VDMVDO) GetVesselBeam ¶ added in v1.4.0
GetVesselBeam retrieves the beam of the vessel from the sentence
func (VDMVDO) GetVesselLength ¶ added in v1.4.0
GetVesselLength retrieves the length of the vessel from the sentence
func (VDMVDO) GetVesselName ¶ added in v1.4.0
GetVesselName retrieves the name of the vessel from the sentence
func (VDMVDO) GetVesselType ¶ added in v1.4.0
GetVesselType retrieves the type of the vessel from the sentence
type VHW ¶ added in v1.4.0
type VHW struct { BaseSentence TrueHeading Float64 MagneticHeading Float64 SpeedThroughWaterKnots Float64 SpeedThroughWaterKPH Float64 }
VHW contains information about water speed and heading
func (VHW) GetMagneticHeading ¶ added in v1.4.0
GetMagneticHeading retrieves the magnetic heading from the sentence
func (VHW) GetSpeedThroughWater ¶ added in v1.4.0
GetSpeedThroughWater retrieves the speed through water from the sentence
func (VHW) GetTrueHeading ¶ added in v1.4.0
GetTrueHeading retrieves the true heading from the sentence
type VTG ¶ added in v1.4.0
type VTG struct { BaseSentence TrueTrack Float64 MagneticTrack Float64 GroundSpeedKnots Float64 GroundSpeedKPH Float64 }
VTG represents track & speed data. http://aprs.gids.nl/nmea/#vtg
func (VTG) GetMagneticCourseOverGround ¶ added in v1.4.0
GetMagneticCourseOverGround retrieves the magnetic course over ground from the sentence
func (VTG) GetSpeedOverGround ¶ added in v1.4.0
GetSpeedOverGround retrieves the speed over ground from the sentence
func (VTG) GetTrueCourseOverGround ¶ added in v1.4.0
GetTrueCourseOverGround retrieves the true course over ground from the sentence
type VWR ¶ added in v1.4.0
type VWR struct { BaseSentence Angle Float64 LeftRightOfBow String WindSpeedInKnots Float64 WindSpeedInMetersPerSecond Float64 WindSpeedInKilometersPerHour Float64 }
VWR - Relative (Apparent) Wind Speed and Angle
func (VWR) GetRelativeWindDirection ¶ added in v1.4.0
GetRelativeWindDirection retrieves the true wind direction from the sentence
func (VWR) GetWindSpeed ¶ added in v1.4.0
GetWindSpeed retrieves wind speed from the sentence
type VesselBeam ¶ added in v1.4.0
VesselBeam retrieves the beam of the vessel from the sentence
type VesselLength ¶ added in v1.4.0
VesselLength retrieves the length of the vessel from the sentence
type VesselName ¶ added in v1.4.0
VesselName retrieves the name of the vessel from the sentence
type VesselType ¶ added in v1.4.0
VesselType retrieves the type of the vessel from the sentence
type WPL ¶ added in v1.4.0
type WPL struct { BaseSentence Latitude Float64 // Latitude Longitude Float64 // Longitude Ident String // Ident of nth waypoint }
WPL contains information about a waypoint location
type WaterTemperature ¶ added in v1.4.0
WaterTemperature retrieves the water temperature from the sentence
type ZDA ¶ added in v1.4.0
type ZDA 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 }
ZDA represents date & time data. http://aprs.gids.nl/nmea/#zda
func (ZDA) GetDateTime ¶ added in v1.4.0
GetDateTime retrieves the date and time in RFC3339Nano format