message

package
v2.3.0-on-1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MESSAGE_LEN13_BASE = 13
	MESSAGE_LEN14_BASE = 269
	MESSAGE_LEN15_BASE = 65805
	MESSAGE_MAX_LEN    = 0x7fff0000 // Large number that works in 32-bit builds.
)
View Source
const (
	MaxMessageSize    message.OptionID = 2
	BlockWiseTransfer message.OptionID = 4
)
View Source
const (
	AlternativeAddress message.OptionID = 2
	HoldOff            message.OptionID = 4
)
View Source
const (
	BadCSMOption message.OptionID = 2
)

Signal Abort Option IDs

+-----+---+---+---------------------+--------+--------+---------+
| No. | C | R | Name                | Format | Length | Default |
+-----+---+---+---------------------+--------+--------+---------+
|   2 |   |   | Bad-CSM-Option      | uint   | 0-2    | (none)  |
+-----+---+---+---------------------+--------+--------+---------+
C=Critical, R=Repeatable
View Source
const (
	Custody message.OptionID = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Code codes.Code

	Token   []byte
	Payload []byte

	Options message.Options //Options must be sorted by ID
}

TcpMessage is a CoAP MessageBase that can encode itself for Message transport.

func (Message) Marshal

func (m Message) Marshal() ([]byte, error)

func (Message) MarshalTo

func (m Message) MarshalTo(buf []byte) (int, error)

func (Message) Size

func (m Message) Size() (int, error)

func (*Message) Unmarshal

func (m *Message) Unmarshal(data []byte) (int, error)

func (*Message) UnmarshalWithHeader

func (m *Message) UnmarshalWithHeader(header MessageHeader, data []byte) (int, error)

type MessageHeader

type MessageHeader struct {
	Token     []byte
	Code      codes.Code
	HeaderLen int
	TotalLen  int
}

func (*MessageHeader) Unmarshal

func (i *MessageHeader) Unmarshal(data []byte) error

Unmarshal infers information about a Message CoAP message from the first fragment.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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