unp

package
v0.0.0-...-f8c32d9 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

UNP is a framing protocol (commandtype, subsystem, command, payload) for communicating with Texas Instruments radio devices

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandType

type CommandType byte
const (
	C_POLL CommandType = iota
	C_SREQ
	C_AREQ
	C_SRSP
	C_RES0
	C_RES1
	C_RES2
	C_RES3
)

func (CommandType) String

func (i CommandType) String() string

type Frame

type Frame struct {
	CommandType CommandType
	Subsystem   Subsystem
	Command     byte
	Payload     []byte
}

type Subsystem

type Subsystem byte
const (
	S_RES0 Subsystem = iota
	S_SYS
	S_MAC
	S_NWK
	S_AF
	S_ZDO
	S_SAPI
	S_UTIL
	S_DBG
	S_APP
	S_OTA
	S_ZNP
	S_SPARE_12
	S_UBL
	S_RES14
	S_APP_CNF
	S_RES16
	S_PROTOBUF
	S_RES18 // RPC_SYS_PB_NWK_MGR
	S_RES19 // RPC_SYS_PB_GW
	S_RES20 // RPC_SYS_PB_OTA_MGR
	S_GP
	S_MAX
)

func (Subsystem) String

func (i Subsystem) String() string

type Unp

type Unp struct {
	Transceiver io.ReadWriter
	// contains filtered or unexported fields
}

func NewWith8BitsPayloadLength

func NewWith8BitsPayloadLength(transmitter io.ReadWriter) *Unp

func (*Unp) ReadFrame

func (u *Unp) ReadFrame() (frame *Frame, err error)

func (*Unp) RenderFrame

func (u *Unp) RenderFrame(frame *Frame) []byte

func (*Unp) WriteFrame

func (u *Unp) WriteFrame(frame *Frame) error

Jump to

Keyboard shortcuts

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