nmserial

package
v0.0.0-...-691c107 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Packet

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

func NewPacket

func NewPacket(expectedLen uint16) (*Packet, error)

func (*Packet) AddBytes

func (pkt *Packet) AddBytes(bytes []byte) bool

func (*Packet) GetBytes

func (pkt *Packet) GetBytes() []byte

func (*Packet) TrimEnd

func (pkt *Packet) TrimEnd(count int)

type SerialSesn

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

func NewSerialSesn

func NewSerialSesn(sx *SerialXport, cfg sesn.SesnCfg) (*SerialSesn, error)

func (*SerialSesn) AbortRx

func (s *SerialSesn) AbortRx(seq uint8) error

func (*SerialSesn) Close

func (s *SerialSesn) Close() error

func (*SerialSesn) CoapIsTcp

func (s *SerialSesn) CoapIsTcp() bool

func (*SerialSesn) Filters

func (*SerialSesn) IsOpen

func (s *SerialSesn) IsOpen() bool

func (*SerialSesn) ListenCoap

func (s *SerialSesn) ListenCoap(
	mc nmcoap.MsgCriteria) (*nmcoap.Listener, error)

func (*SerialSesn) MgmtProto

func (s *SerialSesn) MgmtProto() sesn.MgmtProto

func (*SerialSesn) MtuIn

func (s *SerialSesn) MtuIn() int

func (*SerialSesn) MtuOut

func (s *SerialSesn) MtuOut() int

func (*SerialSesn) Open

func (s *SerialSesn) Open() error

func (*SerialSesn) RxAccept

func (s *SerialSesn) RxAccept() (sesn.Sesn, *sesn.SesnCfg, error)

func (*SerialSesn) RxCoap

func (s *SerialSesn) RxCoap(opt sesn.TxOptions) (coap.Message, error)

func (*SerialSesn) SetFilters

func (s *SerialSesn) SetFilters(txFilter nmcoap.TxMsgFilter,
	rxFilter nmcoap.RxMsgFilter)

func (*SerialSesn) StopListenCoap

func (s *SerialSesn) StopListenCoap(mc nmcoap.MsgCriteria)

func (*SerialSesn) TxCoap

func (s *SerialSesn) TxCoap(m coap.Message) error

func (*SerialSesn) TxRxMgmt

func (s *SerialSesn) TxRxMgmt(m *nmp.NmpMsg,
	timeout time.Duration) (nmp.NmpRsp, error)

func (*SerialSesn) TxRxMgmtAsync

func (s *SerialSesn) TxRxMgmtAsync(m *nmp.NmpMsg,
	timeout time.Duration, ch chan nmp.NmpRsp, errc chan error) error

type SerialXport

type SerialXport struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewSerialXport

func NewSerialXport(cfg *XportCfg) *SerialXport

func (*SerialXport) BuildSesn

func (sx *SerialXport) BuildSesn(cfg sesn.SesnCfg) (sesn.Sesn, error)

func (*SerialXport) Rx

func (sx *SerialXport) Rx() ([]byte, error)

Blocking receive.

func (*SerialXport) Start

func (sx *SerialXport) Start() error

func (*SerialXport) Stop

func (sx *SerialXport) Stop() error

func (*SerialXport) Tx

func (sx *SerialXport) Tx(bytes []byte) error

type XportCfg

type XportCfg struct {
	DevPath     string
	Baud        int
	Mtu         int
	ReadTimeout time.Duration
}

func NewXportCfg

func NewXportCfg() *XportCfg

Jump to

Keyboard shortcuts

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