ocf

package
v0.0.0-...-48b1b68 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(message *message.Message) string

Dump a COAP message to a string. If parsing fails, the error is appended.

func DumpHeader

func DumpHeader(m *message.Message) string

DumpHeader dumps the basic COAP message details to a string.

func DumpPayload

func DumpPayload(m *message.Message) (string, error)

DumpPayload dumps the COAP message payload to a string.

Types

type NoCodec

type NoCodec struct{ MediaType uint16 }

NoCodec performes no encoding/decoding but it propagates/validates the CoAP content format/media type.

func (NoCodec) ContentFormat

func (c NoCodec) ContentFormat() message.MediaType

ContentFormat propagates the CoAP media type.

func (NoCodec) Decode

func (c NoCodec) Decode(m *message.Message, v interface{}) error

Decode validates the content format and propagates the payload to v as *[]byte without any conversions.

func (NoCodec) Encode

func (c NoCodec) Encode(v interface{}) ([]byte, error)

Encode propagates the payload without any conversions.

type RawVNDOCFCBORCodec

type RawVNDOCFCBORCodec struct{}

RawVNDOCFCBORCodec performes no encoding/decoding but it propagates/validates the CoAP content format/media type.

func (RawVNDOCFCBORCodec) ContentFormat

func (RawVNDOCFCBORCodec) ContentFormat() message.MediaType

ContentFormat used for encoding.

func (RawVNDOCFCBORCodec) Decode

func (c RawVNDOCFCBORCodec) Decode(m *message.Message, v interface{}) error

Decode validates the content format and propagates the payload to v as *[]byte without any conversions.

func (RawVNDOCFCBORCodec) Encode

func (c RawVNDOCFCBORCodec) Encode(v interface{}) ([]byte, error)

Encode propagates the payload without any conversions.

type VNDOCFCBORCodec

type VNDOCFCBORCodec struct{}

VNDOCFCBORCodec encodes/decodes according to the CoAP content format/media type.

func (VNDOCFCBORCodec) ContentFormat

func (VNDOCFCBORCodec) ContentFormat() message.MediaType

ContentFormat used for encoding.

func (VNDOCFCBORCodec) Decode

func (VNDOCFCBORCodec) Decode(m *message.Message, v interface{}) error

Decode the CBOR payload of a COAP message.

func (VNDOCFCBORCodec) Encode

func (VNDOCFCBORCodec) Encode(v interface{}) ([]byte, error)

Encode encodes v and returns bytes.

Jump to

Keyboard shortcuts

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