parser

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MAGIC_NUMBER_V1 const value for common use
	MAGIC_NUMBER_V1 packet.MAGIC_NUMBER = 0xfe
)

Variables

This section is empty.

Functions

func NewPacketV1

func NewPacketV1(sysID uint8, compID uint8, seqID uint8, message message.Message) (packet.Packet, error)

NewPacketV1 creates new mavlink1.Packet

func NewPacketV2

func NewPacketV2(sysID uint8, compID uint8, seqID uint8, message message.Message) (packet.Packet, error)

NewPacketV2 creates new mavlink2.Packet

Types

type MAVLINK1_PARSE_STATE

type MAVLINK1_PARSE_STATE int

MAVLINK1_PARSE_STATE typedef

const (
	MAVLINK1_PARSE_STATE_UNINIT           MAVLINK1_PARSE_STATE = iota
	MAVLINK1_PARSE_STATE_IDLE             MAVLINK1_PARSE_STATE = iota
	MAVLINK1_PARSE_STATE_GOT_STX          MAVLINK1_PARSE_STATE = iota
	MAVLINK1_PARSE_STATE_GOT_LENGTH       MAVLINK1_PARSE_STATE = iota
	MAVLINK1_PARSE_STATE_GOT_SEQ          MAVLINK1_PARSE_STATE = iota
	MAVLINK1_PARSE_STATE_GOT_SYSID        MAVLINK1_PARSE_STATE = iota
	MAVLINK1_PARSE_STATE_GOT_COMPID       MAVLINK1_PARSE_STATE = iota
	MAVLINK1_PARSE_STATE_GOT_MSGID1       MAVLINK1_PARSE_STATE = iota
	MAVLINK1_PARSE_STATE_GOT_PAYLOAD      MAVLINK1_PARSE_STATE = iota
	MAVLINK1_PARSE_STATE_GOT_CRC1         MAVLINK1_PARSE_STATE = iota
	MAVLINK1_PARSE_STATE_GOT_BAD_CRC      MAVLINK1_PARSE_STATE = iota
	MAVLINK1_PARSE_STATE_GOT_GOOD_MESSAGE MAVLINK1_PARSE_STATE = iota
)

MAVLINK1_PARSE_STATES

func (MAVLINK1_PARSE_STATE) String

func (s MAVLINK1_PARSE_STATE) String() string

type MAVLINK2_PARSE_STATE

type MAVLINK2_PARSE_STATE int

MAVLINK2_PARSE_STATE typedef

const (
	MAVLINK2_PARSE_STATE_UNINIT             MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_IDLE               MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_STX            MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_LENGTH         MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_INCOMPAT_FLAGS MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_COMPAT_FLAGS   MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_SEQ            MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_SYSID          MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_COMPID         MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_MSGID1         MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_MSGID2         MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_MSGID3         MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_PAYLOAD        MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_CRC1           MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_BAD_CRC        MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_GOT_GOOD_MESSAGE   MAVLINK2_PARSE_STATE = iota
	MAVLINK2_PARSE_STATE_WAIT_SIGNATURE     MAVLINK2_PARSE_STATE = iota
)

MAVLINK2_PARSE_STATES

func (MAVLINK2_PARSE_STATE) String

func (s MAVLINK2_PARSE_STATE) String() string
type MAVLINK_IFLAG uint8

MAVLINK_IFLAG type

const (
	// MAGIC_NUMBER_V2 const value for common use
	MAGIC_NUMBER_V2 packet.MAGIC_NUMBER = 0xfd
	// MAVLINK_IFLAG_SIGNED constant
	MAVLINK_IFLAG_SIGNED MAVLINK_IFLAG = 0b00000001
)

type Parser

type Parser interface {
	ParseChar(c byte) (packet.Packet, error)
	String() string
	Destroy()
}

Parser interface is abstract of parsers

func NewParserV1

func NewParserV1() Parser

NewParserV1 returns Parser from inner pool

func NewParserV2

func NewParserV2() Parser

NewParserV2 returns Parser from inner pool

Jump to

Keyboard shortcuts

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