omp

package
v0.0.0-...-0602f2a Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const OMP_MSG_OVERHEAD = 13

OIC wrapping adds this many bytes to an NMP message. Calculated by comparing an OMP message with its NMP equivalent.

Variables

This section is empty.

Functions

func DecodeOmp

func DecodeOmp(m coap.Message) (nmp.NmpRsp, error)

* Not able to install custom decoder for indefite length objects with the * codec. So we need to decode the whole response, and then re-encode the * newtmgr response part.

func EncodeOmpDgram

func EncodeOmpDgram(nmr *nmp.NmpMsg) ([]byte, error)

func EncodeOmpTcp

func EncodeOmpTcp(nmr *nmp.NmpMsg) ([]byte, error)

Types

type Dispatcher

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

The dispatcher is the owner of the listeners it points to. Only the dispatcher writes to these listeners.

func NewDispatcher

func NewDispatcher(isTcp bool, logDepth int) (*Dispatcher, error)

func (*Dispatcher) AddNmpListener

func (d *Dispatcher) AddNmpListener(seq uint8) (*nmp.Listener, error)

func (*Dispatcher) AddOicListener

func (d *Dispatcher) AddOicListener(token []byte) (*oic.Listener, error)

func (*Dispatcher) Dispatch

func (d *Dispatcher) Dispatch(data []byte) bool

func (*Dispatcher) ErrorAll

func (d *Dispatcher) ErrorAll(err error)

func (*Dispatcher) ErrorOneNmp

func (d *Dispatcher) ErrorOneNmp(seq uint8, err error) error

func (*Dispatcher) RemoveNmpListener

func (d *Dispatcher) RemoveNmpListener(seq uint8) *nmp.Listener

func (*Dispatcher) RemoveOicListener

func (d *Dispatcher) RemoveOicListener(token []byte) *oic.Listener

func (*Dispatcher) Stop

func (d *Dispatcher) Stop()

type OicMsg

type OicMsg struct {
	Hdr []byte `codec:"_h"`
}

Jump to

Keyboard shortcuts

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