aisnmea

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2021 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	//SentenceNotVDMVDO will be returned if the provided sentence is of the wrong type
	SentenceNotVDMVDO string = "Sentence was not of the VDM or VDO type"
)

Variables

View Source
var BlankTagBlock nmea.TagBlock

BlankTagBlock is a pseudo-constant for convenient comparisons to a blank value

Functions

This section is empty.

Types

type NMEACodec

type NMEACodec struct {
	MaxLineLength int

	AppendChecksum bool
	// contains filtered or unexported fields
}

NMEACodec is a convenience code that allows easy encoding and decoding of NMEA as produced by an AIS receiver

func NMEACodecNew

func NMEACodecNew(codec *ais.Codec) *NMEACodec

NMEACodecNew creates a NMEACodec. You need to provide a configured ais.Codec

func (*NMEACodec) BufferedMessages

func (nc *NMEACodec) BufferedMessages() int

BufferedMessages return the number of messages buffered in the reassembler

func (*NMEACodec) EncodeSentence

func (nc *NMEACodec) EncodeSentence(p VdmPacket) []string

EncodeSentence encodes the provided packet into zero or more NMEA sentences

func (*NMEACodec) ParseSentence

func (nc *NMEACodec) ParseSentence(sentence string) (*VdmPacket, error)

ParseSentence decodes a NMEA sentence containing an AIS message

func (*NMEACodec) ParseVDMVDO

func (nc *NMEACodec) ParseVDMVDO(m *nmea.VDMVDO) (*VdmPacket, error)

ParseVDMVDO parses a message contained in a nmea.VDMVDO struct

type VdmPacket

type VdmPacket struct {
	Channel     byte
	TalkerID    string
	MessageType string
	Payload     []byte
	Packet      ais.Packet
	TagBlock    nmea.TagBlock
}

VdmPacket is a packet that can be encoded into or decoded from a NMEA sentence

Jump to

Keyboard shortcuts

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