Documentation ¶
Overview ¶
package nmeanano ... This is a [minimal|static|optimize] fork of the great github.com/adrianmo/go-nmea pkg! This fork is adapted and optimized for an specific use-case and *IS NOT* api/result compatible with the original, please DO NOT use outside very specific use cases!.PLEASE USE ALWAYS THE ORIGINAL!
Copyright (c) 2015 Adrian Moreno - The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy (of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- func Checksum(s string) string
- func FormatDMS(l float64) string
- func FormatGPS(l float64) string
- func GetTimeStamp(x RMC) time.Time
- func LatDir(l float64) string
- func LonDir(l float64) string
- func MustRegisterParser(sentenceType string, parser ParserFunc)
- func ParseDMS(_ string) (float64, error)
- func ParseDecimal(s string) (float64, error)
- func ParseGPS(s string) (float64, error)
- func ParseLatLong(s string) (float64, error)
- func RegisterParser(sentenceType string, parser ParserFunc) error
- type BaseSentence
- type Date
- type GGA
- type GNS
- type GSA
- type GSV
- type GSVInfo
- 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) []string
- 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) (list []string)
- func (p *Parser) SetErr(context, value string)
- func (p *Parser) SixBitASCIIArmour(i, 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 RMC
- type Sentence
- type TagBlock
- type Time
- type VDMVDO
- type VTG
Constants ¶
const ( // TypeGGA ... TypeGGA = "GGA" // Invalid ... Invalid = "0" // GPS ... GPS = "1" // DGPS ... DGPS = "2" // PPS ... PPS = "3" // RTK ... RTK = "4" // FRTK ... FRTK = "5" // EST ... EST = "6" )
const ( // TypeGNS ... TypeGNS = "GNS" NoFixGNS = "N" AutonomousGNS = "A" DifferentialGNS = "D" PreciseGNS = "P" RealTimeKinematicGNS = "R" FloatRTKGNS = "F" EstimatedGNS = "E" ManualGNS = "M" SimulatorGNS = "S" )
const ( // TypeGSA TypeGSA = "GSA" TypeGSV = "GSV" Auto = "A" Manual = "M" FixNone = "1" Fix2D = "2" Fix3D = "3" )
const ( TypeRMC = "RMC" ValidRMC = "A" InvalidRMC = "V" )
const ( SentenceStart = "$" SentenceStartEncapsulated = "!" FieldSep = "," ChecksumSep = "*" )
const ( Degrees = '\u00B0' Minutes = '\'' Seconds = '"' Point = '.' North = "N" South = "S" East = "E" West = "W" )
const ( TypeVDM = "VDM" TypeVDO = "VDO" )
const (
TypeVTG = "VTG"
)
Variables ¶
This section is empty.
Functions ¶
func GetTimeStamp ¶
GetTimeStamp returns an validated go time.Time timestamp
func MustRegisterParser ¶
func MustRegisterParser(sentenceType string, parser ParserFunc)
func ParseDecimal ¶
func ParseLatLong ¶
func RegisterParser ¶
func RegisterParser(sentenceType string, parser ParserFunc) error
Types ¶
type BaseSentence ¶
type BaseSentence struct { Talker string Type string Fields []string Checksum string Raw string TagBlock TagBlock }
BaseSentence ...
func (BaseSentence) DataType ¶
func (s BaseSentence) DataType() string
func (BaseSentence) Prefix ¶
func (s BaseSentence) Prefix() string
func (BaseSentence) String ¶
func (s BaseSentence) String() string
func (BaseSentence) TalkerID ¶
func (s BaseSentence) TalkerID() string
type GGA ¶
type GGA struct { BaseSentence Time Time Latitude float64 Longitude float64 FixQuality string NumSatellites int64 HDOP float64 Altitude float64 Separation float64 DGPSAge string DGPSId string }
GGA ...
type GNS ¶
type GNS struct { BaseSentence Time Time Latitude float64 Longitude float64 Mode []string SVs int64 HDOP float64 Altitude float64 Separation float64 Age float64 Station int64 }
GNS ...
type GSA ¶
type GSA struct { BaseSentence Mode string FixType string SV []string PDOP float64 HDOP float64 VDOP float64 }
GSA ...
type GSV ¶
type GSV struct { BaseSentence TotalMessages int64 MessageNumber int64 NumberSVsInView int64 Info []GSVInfo }
GSV ...
type Parser ¶
type Parser struct { BaseSentence // contains filtered or unexported fields }
Parser ...
func (*Parser) AssertType ¶
func (*Parser) EnumString ¶
EnumString ...
func (*Parser) ListString ¶
ListString ...
func (*Parser) SixBitASCIIArmour ¶
SixBitASCIIArmour ..
type ParserFunc ¶
type ParserFunc func(BaseSentence) (Sentence, error)
type RMC ¶
type RMC struct { BaseSentence Time Time Validity string Latitude float64 Longitude float64 Speed float64 Course float64 Date Date Variation float64 }
RMC ...