nmea

package module
v0.0.0-...-af338e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2024 License: BSD-2-Clause Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MessageTypes map[string]reflect.Type = make(map[string]reflect.Type)

Functions

func Checksum

func Checksum(s string) byte

func Knt2Kmh

func Knt2Kmh(s float64) float64

knots to km/h

func NMEADate

func NMEADate(timestamp time.Time) string

Format a time.Time to NMEA RMC date DDMMYY

func NMEALatLon

func NMEALatLon(pos float64) string

Format a position in DDDMM.mmmmm format

func NMEATimestamp

func NMEATimestamp(timestamp time.Time) string

Format a time.Time to NMEA GLL time HHmmss.ss

func Sentence

func Sentence(n nmea_sentence) string

func Wind2Angle

func Wind2Angle(dir float64) float64

Convert an relative wind direction (TWA,AWA) (+/- 0->180) to an absolute wind angle (0->359)

func WriteMessage

func WriteMessage(b NMEABoat, seq []string) string

Types

type GGA

type GGA struct {
	GLL
	// contains filtered or unexported fields
}

GGA - Geographic Position - Latitude/Longitude

func (*GGA) FromBoat

func (gga *GGA) FromBoat(b NMEABoat)

func (*GGA) GpsQual

func (gga *GGA) GpsQual() int

func (*GGA) Header

func (n *GGA) Header() string

func (*GGA) SetOpt

func (n *GGA) SetOpt(b byte)

func (*GGA) Values

func (gga *GGA) Values() string

type GLL

type GLL struct {
	// contains filtered or unexported fields
}

GLL - Geographic Position - Latitude/Longitude

func (*GLL) FromBoat

func (gll *GLL) FromBoat(b NMEABoat)

func (*GLL) Header

func (n *GLL) Header() string

func (*GLL) SetOpt

func (n *GLL) SetOpt(b byte)

func (*GLL) Values

func (gll *GLL) Values() string

type HDT

type HDT struct {
	// contains filtered or unexported fields
}

HDT - Heading True - Actual vessel heading in degrees true

func (*HDT) FromBoat

func (hdt *HDT) FromBoat(b NMEABoat)

func (*HDT) Header

func (n *HDT) Header() string

func (*HDT) SetOpt

func (n *HDT) SetOpt(b byte)

func (*HDT) Values

func (hdt *HDT) Values() string

type MWV

type MWV struct {
	// contains filtered or unexported fields
}

MWV can be send for True wind or Aparent wind

func (*MWV) FromBoat

func (mwv *MWV) FromBoat(b NMEABoat)

Wind angle is relative to the boat, from 0 to 359

func (*MWV) Header

func (n *MWV) Header() string

func (*MWV) SetOpt

func (mwv *MWV) SetOpt(b byte)

func (*MWV) Values

func (mwv *MWV) Values() string

type NMEABoat

type NMEABoat struct {
	Timestamp time.Time
	Latitude  float64
	Longitude float64
	Cog       float64
	Sog       float64
	Spd       float64
	Hdg       float64
	Awa       float64
	Aws       float64
	Twa       float64
	Tws       float64
}

type RMC

type RMC struct {
	GLL
	Sog float64
	Cog float64
}

RMC - Recommended Minimum Navigation Information

func (*RMC) FromBoat

func (rmc *RMC) FromBoat(b NMEABoat)

func (*RMC) Header

func (n *RMC) Header() string

func (*RMC) SetOpt

func (n *RMC) SetOpt(b byte)

func (*RMC) Values

func (rmc *RMC) Values() string

type VHW

type VHW struct {
	// contains filtered or unexported fields
}

VHW is composed by a nmea_sentence, plus heading and stw

func (*VHW) FromBoat

func (vhw *VHW) FromBoat(b NMEABoat)

func (*VHW) Header

func (n *VHW) Header() string

func (*VHW) SetOpt

func (n *VHW) SetOpt(b byte)

func (*VHW) Values

func (vhw *VHW) Values() string

type VTG

type VTG struct {
	VHW
}

VTG is VHW with ground for reference

func (*VTG) FromBoat

func (vtg *VTG) FromBoat(b NMEABoat)

func (*VTG) Header

func (n *VTG) Header() string

func (*VTG) SetOpt

func (n *VTG) SetOpt(b byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL