omp

package
v0.0.0-...-9b3e15a Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 8 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, rxFilter nmcoap.RxMsgFilter) (nmp.NmpRsp, error)

* Not able to install custom decoder for indefinite 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(txFilter nmcoap.TxMsgFilter, nmr *nmp.NmpMsg) ([]byte, error)

func EncodeOmpTcp

func EncodeOmpTcp(txFilter nmcoap.TxMsgFilter, 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(rxFilter nmcoap.RxMsgFilter, isTcp bool,
	logDepth int) (*Dispatcher, error)

func (*Dispatcher) AddCoapListener

func (d *Dispatcher) AddCoapListener(
	mc nmcoap.MsgCriteria) (*nmcoap.Listener, error)

func (*Dispatcher) AddNmpListener

func (d *Dispatcher) AddNmpListener(seq uint8) (*nmp.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) ProcessCoapReq

func (d *Dispatcher) ProcessCoapReq(data []byte) (coap.Message, error)

func (*Dispatcher) RemoveCoapListener

func (d *Dispatcher) RemoveCoapListener(
	mc nmcoap.MsgCriteria) *nmcoap.Listener

func (*Dispatcher) RemoveNmpListener

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

func (*Dispatcher) RxFilter

func (d *Dispatcher) RxFilter() nmcoap.RxMsgFilter

func (*Dispatcher) SetRxFilter

func (d *Dispatcher) SetRxFilter(rxFilter nmcoap.RxMsgFilter)

func (*Dispatcher) Stop

func (d *Dispatcher) Stop()

type Listener

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

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