message

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

Package message contains the message definition and its parser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message interface {
	GetID() uint32
}

Message is the interface that must be implemented by all Mavlink messages. Furthermore, any message struct must be labeled "MessageNameOfMessage".

type MessageRaw

type MessageRaw struct {
	ID      uint32
	Payload []byte
}

MessageRaw is a special struct that contains an unencoded message. It is used:

* as intermediate step in the encoding/decoding process

* when the parser receives an unknown message

func (*MessageRaw) GetID

func (m *MessageRaw) GetID() uint32

GetID implements the Message interface.

type ReadWriter

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

ReadWriter is a Message Reader and Writer.

func NewReadWriter

func NewReadWriter(msg Message) (*ReadWriter, error)

NewReadWriter allocates a ReadWriter.

func (*ReadWriter) CRCExtra

func (mde *ReadWriter) CRCExtra() byte

CRCExtra returns the CRC extra of the message.

func (*ReadWriter) Read

func (mde *ReadWriter) Read(m *MessageRaw, isV2 bool) (Message, error)

Read converts a *MessageRaw into a Message.

func (*ReadWriter) Write

func (mde *ReadWriter) Write(msg Message, isV2 bool) *MessageRaw

Write converts a Message into a *MessageRaw.

Jump to

Keyboard shortcuts

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