message

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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 {
	Token   []byte
	Payload []byte

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

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
	HeaderLen uint32
	TotalLen  uint32
	Code      codes.Code
}

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