nmeaais

package module
v0.0.0-...-1ebe802 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 7 Imported by: 1

README

nmeaais

NMEA AIS data stuff. Not for public consumption yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressedSafetyRelated

type AddressedSafetyRelated struct {
	MessageType     int64
	RepeatIndicator int64
	MMSI            int64
	SequenceNumber  int64
	DestinationMMSI int64
	RetransmitFlag  bool
	Text            string
}

type AidToNavigationReport

type AidToNavigationReport struct {
	MessageType          int64
	RepeatIndicator      int64
	MMSI                 int64
	AidType              string
	Name                 string
	PositionAccuracy     bool
	Longitude            float64
	Latitude             float64
	DimensionToBow       int64
	DimensionToStern     int64
	DimensionToPort      int64
	DimensionToStarboard int64
	EPFDType             string
	UTCSecond            int64
	OffPositionIndicator bool
	RAIM                 bool
	VirtualAid           bool
	AssignedMode         bool
	NameExtension        string
}

type AssignmentModeCommand

type AssignmentModeCommand struct {
	MessageType      int64
	RepeatIndicator  int64
	MMSI             int64
	DestinationMMSI1 int64
	Offset1          int64
	Increment1       int64
	DestinationMMSI2 int64
	Offset2          int64
	Increment2       int64
}

type BaseStationReport

type BaseStationReport struct {
	MessageType      int64
	RepeatIndicator  int64
	MMSI             int64
	TimeStamp        time.Time
	PositionAccuracy bool
	Longitude        float64
	Latitude         float64
	EPFDType         string
	RAIM             bool
	RadioStatus      int64
}

type BinaryAcknowledge

type BinaryAcknowledge struct {
	MessageType     int64
	RepeatIndicator int64
	MMSI            int64
	MMSI1           int64
	MMSI1Sequence   int64
	MMSI2           int64
	MMSI2Sequence   int64
	MMSI3           int64
	MMSI3Sequence   int64
	MMSI4           int64
	MMSI4Sequence   int64
}

type BinaryAddressedMessage

type BinaryAddressedMessage struct {
	MessageType        int64
	RepeatIndicator    int64
	MMSI               int64
	SequenceNumber     int64
	DestinationMMSI    int64
	RetransmitFlag     bool
	DesignatedAreaCode int64
	FunctionalID       int64
	Data               []byte
}

type BinaryBroadcastMessage

type BinaryBroadcastMessage struct {
	MessageType        int64
	RepeatIndicator    int64
	MMSI               int64
	DesignatedAreaCode int64
	FunctionalID       int64
	Data               []byte
}

type ChannelManagement

type ChannelManagement struct {
	MessageType     int64
	RepeatIndicator int64
	MMSI            int64
	ChannelA        int64
	ChannelB        int64
	TxRxMode        int64
	Power           bool
	NELongitude     float64
	NELatitutde     float64
	SWLongitude     float64
	SWLatitude      float64
	MMSI1           int64
	MMSI2           int64
	Addressed       bool
	ChannelABand    bool
	ChannelBBand    bool
	ZoneSize        int64
}

type DGNSSBroadcastBinaryMessage

type DGNSSBroadcastBinaryMessage struct {
	MessageType     int64
	RepeatIndicator int64
	MMSI            int64
	Longitude       float64
	Latitude        float64
	Payload         []byte
}

type DataLinkManagementMessage

type DataLinkManagementMessage struct {
	MessageType     int64
	RepeatIndicator int64
	MMSI            int64
	Offset1         int64
	ReservedSlots1  int64
	Timeout1        int64
	Increment1      int64
	Offset2         int64
	ReservedSlots2  int64
	Timeout2        int64
	Increment2      int64
	Offset3         int64
	ReservedSlots3  int64
	Timeout3        int64
	Increment3      int64
	Offset4         int64
	ReservedSlots4  int64
	Timeout4        int64
	Increment4      int64
}

type Decoder

type Decoder struct {
	Input  chan DecoderInput
	Output chan DecoderOutput
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder() *Decoder

type DecoderInput

type DecoderInput struct {
	Input     string
	Timestamp time.Time
}

type DecoderOutput

type DecoderOutput struct {
	SourcePackets  []*Packet
	SourceMessage  *Message
	DecodedMessage interface{}
	Error          error
	Timestamp      time.Time
}

type GroupAssignmentCommand

type GroupAssignmentCommand struct {
	MessageType     int64
	RepeatIndicator int64
	MMSI            int64
	NELongitude     float64
	NELatitutde     float64
	SWLongitude     float64
	SWLatitude      float64
	StationType     string
	ShipType        string
	TxRxMode        int64
	ReportInterval  string
	QuietTime       int64
}

type Interrogation

type Interrogation struct {
	MessageType        int64
	RepeatIndicator    int64
	MMSI               int64
	InterrogatedMMSI1  int64
	FirstMessageType1  int64
	FirstSlotOffset1   int64
	SecondMessageType1 int64
	SecondSlotOffset1  int64
	InterrogatedMMSI2  int64
	FirstMessageType2  int64
	FirstSlotOffset2   int64
}

type LongRangeAISBroadcast

type LongRangeAISBroadcast struct {
	MessageType        int64
	RepeatIndicator    int64
	MMSI               int64
	PositionAccuracy   bool
	RAIM               bool
	NavigationStatus   string
	Longitude          float64
	Latitude           float64
	SpeedOverGround    float64
	CourseOverGround   float64
	GNSSPositionStatus int64
}

type Message

type Message struct {
	Packets []*Packet

	MessageType     int64
	RepeatIndicator int64
	MMSI            int64
	// contains filtered or unexported fields
}

func Process

func Process(packets []*Packet) (*Message, error)

func (*Message) GetAsAddressedSafetyRelated

func (m *Message) GetAsAddressedSafetyRelated() (p *AddressedSafetyRelated, err error)

func (*Message) GetAsAidToNavigationReport

func (m *Message) GetAsAidToNavigationReport() (p *AidToNavigationReport, err error)

func (*Message) GetAsAssignmentModeCommand

func (m *Message) GetAsAssignmentModeCommand() (p *AssignmentModeCommand, err error)

func (*Message) GetAsBaseStationReport

func (m *Message) GetAsBaseStationReport() (p *BaseStationReport, err error)

func (*Message) GetAsBinaryAcknowledge

func (m *Message) GetAsBinaryAcknowledge() (p *BinaryAcknowledge, err error)

func (*Message) GetAsBinaryAddressedMessage

func (m *Message) GetAsBinaryAddressedMessage() (p *BinaryAddressedMessage, err error)

func (*Message) GetAsBinaryBroadcastMessage

func (m *Message) GetAsBinaryBroadcastMessage() (p *BinaryBroadcastMessage, err error)

func (*Message) GetAsChannelManagement

func (m *Message) GetAsChannelManagement() (p *ChannelManagement, err error)

func (*Message) GetAsDGNSSBroadcastBinaryMessage

func (m *Message) GetAsDGNSSBroadcastBinaryMessage() (p *DGNSSBroadcastBinaryMessage, err error)

func (*Message) GetAsDataLinkManagementMessage

func (m *Message) GetAsDataLinkManagementMessage() (p *DataLinkManagementMessage, err error)

func (*Message) GetAsGroupAssignmentCommand

func (m *Message) GetAsGroupAssignmentCommand() (p *GroupAssignmentCommand, err error)

func (*Message) GetAsInterrogation

func (m *Message) GetAsInterrogation() (p *Interrogation, err error)

func (*Message) GetAsLongRangeAISBroadcast

func (m *Message) GetAsLongRangeAISBroadcast() (p *LongRangeAISBroadcast, err error)

func (*Message) GetAsPositionReportClassA

func (m *Message) GetAsPositionReportClassA() (p *PositionReportClassA, err error)

func (*Message) GetAsPositionReportClassBExtended

func (m *Message) GetAsPositionReportClassBExtended() (p *PositionReportClassBExtended, err error)

func (*Message) GetAsPositionReportClassBStandard

func (m *Message) GetAsPositionReportClassBStandard() (p *PositionReportClassBStandard, err error)

func (*Message) GetAsSafetyRelatedAcknowledge

func (m *Message) GetAsSafetyRelatedAcknowledge() (p *SafetyRelatedAcknowledge, err error)

func (*Message) GetAsSafetyRelatedBroadcast

func (m *Message) GetAsSafetyRelatedBroadcast() (p *SafetyRelatedBroadcast, err error)

func (*Message) GetAsSingleSlotBinaryMessage

func (m *Message) GetAsSingleSlotBinaryMessage() (p *SingleSlotBinaryMessage, err error)

func (*Message) GetAsStandardSARAircraftPositionReport

func (m *Message) GetAsStandardSARAircraftPositionReport() (p *StandardSARAircraftPositionReport, err error)

func (*Message) GetAsStaticAndVoyageRelatedData

func (m *Message) GetAsStaticAndVoyageRelatedData() (p *StaticAndVoyageRelatedData, err error)

func (*Message) GetAsStaticDataReportA

func (m *Message) GetAsStaticDataReportA() (p *StaticDataReportA, err error)

func (*Message) GetAsStaticDataReportB

func (m *Message) GetAsStaticDataReportB() (p *StaticDataReportB, err error)

func (*Message) GetAsUTCDateInquiry

func (m *Message) GetAsUTCDateInquiry() (p *UTCDateInquiry, err error)

func (*Message) GetAsUTCDateResponse

func (m *Message) GetAsUTCDateResponse() (p *UTCDateResponse, err error)

func (*Message) IsStaticDataReportA

func (m *Message) IsStaticDataReportA() (bool, error)

func (*Message) IsStaticDataReportB

func (m *Message) IsStaticDataReportB() (bool, error)

type Packet

type Packet struct {
	Raw                 string
	StartDelimiter      string
	Tag                 string
	FragmentCount       int64
	FragmentNumber      int64
	SequentialMessageID int64
	RadioChannel        string
	Payload             string
	FillBits            int64
	Checksum            string
	Timestamp           time.Time
}

func Parse

func Parse(raw string) (*Packet, error)

func ParseAtTime

func ParseAtTime(raw string, timestamp time.Time) (*Packet, error)

type PacketAccumulator

type PacketAccumulator struct {
	Packets chan *Packet
	Results chan *PacketAccumulatorResult
}

func NewPacketAccumulator

func NewPacketAccumulator() *PacketAccumulator

type PacketAccumulatorResult

type PacketAccumulatorResult struct {
	Packets   []*Packet
	Message   *Message
	Error     error
	Timestamp time.Time
}

type PositionReportClassA

type PositionReportClassA struct {
	MessageType       int64
	RepeatIndicator   int64
	MMSI              int64
	NavigationStatus  string
	RateOfTurn        float64
	SpeedOverGround   float64
	PositionAccuracy  bool
	Longitude         float64
	Latitude          float64
	CourseOverGround  float64
	TrueHeading       int64
	TimeStamp         int64
	ManeuverIndicator string
	RAIM              bool
	RadioStatus       int64
}

type PositionReportClassBExtended

type PositionReportClassBExtended struct {
	MessageType          int64
	RepeatIndicator      int64
	MMSI                 int64
	SpeedOverGround      float64
	PositionAccuracy     bool
	Longitude            float64
	Latitude             float64
	CourseOverGround     float64
	TrueHeading          int64
	TimeStamp            int64
	VesselName           string
	ShipType             string
	DimensionToBow       int64
	DimensionToStern     int64
	DimensionToPort      int64
	DimensionToStarboard int64
	EPFDType             string
	RAIM                 bool
	DTE                  bool
	Assigned             bool
}

type PositionReportClassBStandard

type PositionReportClassBStandard struct {
	MessageType      int64
	RepeatIndicator  int64
	MMSI             int64
	SpeedOverGround  float64
	PositionAccuracy bool
	Longitude        float64
	Latitude         float64
	CourseOverGround float64
	TrueHeading      int64
	TimeStamp        int64
	CSUnit           bool
	Display          bool
	DSC              bool
	Band             bool
	Message22        bool
	Assigned         bool
	RAIM             bool
	RadioStatus      int64
}

type SafetyRelatedAcknowledge

type SafetyRelatedAcknowledge struct {
	MessageType     int64
	RepeatIndicator int64
	MMSI            int64
	MMSI1           int64
	MMSI1Sequence   int64
	MMSI2           int64
	MMSI2Sequence   int64
	MMSI3           int64
	MMSI3Sequence   int64
	MMSI4           int64
	MMSI4Sequence   int64
}

type SafetyRelatedBroadcast

type SafetyRelatedBroadcast struct {
	MessageType     int64
	RepeatIndicator int64
	MMSI            int64
	SequenceNumber  int64
	DestinationMMSI int64
	RetransmitFlag  bool
	Text            string
}

type SingleSlotBinaryMessage

type SingleSlotBinaryMessage struct {
	MessageType        int64
	RepeatIndicator    int64
	MMSI               int64
	Addressed          bool
	Structured         bool
	DestinationMMSI    int64
	DesignatedAreaCode int64
	FunctionalID       int64
	Data               []byte
}

type StandardSARAircraftPositionReport

type StandardSARAircraftPositionReport struct {
	MessageType      int64
	RepeatIndicator  int64
	MMSI             int64
	Altitude         int64
	SpeedOverGround  float64
	PositionAccuracy bool
	Longitude        float64
	Latitude         float64
	CourseOverGround float64
	TimeStamp        int64
	DTE              bool
	Assigned         bool
	RAIM             bool
	RadioStatus      int64
}

type StaticAndVoyageRelatedData

type StaticAndVoyageRelatedData struct {
	MessageType          int64
	RepeatIndicator      int64
	MMSI                 int64
	AISVersion           int64
	IMONumber            int64
	CallSign             string
	VesselName           string
	ShipType             string
	DimensionToBow       int64
	DimensionToStern     int64
	DimensionToPort      int64
	DimensionToStarboard int64
	EPFDType             string
	ETAMonth             int64
	ETADay               int64
	ETAHour              int64
	ETAMinute            int64
	Draught              float64
	Destination          string
	DTE                  bool
}

type StaticDataReportA

type StaticDataReportA struct {
	MessageType     int64
	RepeatIndicator int64
	MMSI            int64
	PartNumber      int64
	VesselName      string
}

type StaticDataReportB

type StaticDataReportB struct {
	MessageType          int64
	RepeatIndicator      int64
	MMSI                 int64
	PartNumber           int64
	ShipType             string
	VendorID             string
	UnitModelCode        int64
	SerialNumber         int64
	CallSign             string
	DimensionToBow       int64
	DimensionToStern     int64
	DimensionToPort      int64
	DimensionToStarboard int64
	MothershipMMSI       int64
}

type UTCDateInquiry

type UTCDateInquiry struct {
	MessageType     int64
	RepeatIndicator int64
	MMSI            int64
	DestinationMMSI int64
}

type UTCDateResponse

type UTCDateResponse struct {
	MessageType      int64
	RepeatIndicator  int64
	MMSI             int64
	TimeStamp        time.Time
	PositionAccuracy bool
	Longitude        float64
	Latitude         float64
	EPFDType         string
	RAIM             bool
	RadioStatus      int64
}

Directories

Path Synopsis
cmd
nmeaais-decoder command

Jump to

Keyboard shortcuts

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