tx

package
v0.0.0-...-6270c53 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2019 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NI = [...]byte{'N', 'I'}

Functions

func Addr16

func Addr16(addr uint16) func(interface{})

Addr16 helper options function to set frames 16-bit address

func Addr64

func Addr64(addr uint64) func(interface{})

Addr64 helper options function to set frames 64-bit address

func BroadcastRadius

func BroadcastRadius(hops byte) func(interface{})

BroadcastRadius helper options function to set frame broadcast radius

func ClusterID

func ClusterID(id uint16) func(interface{})

ClusterID helper options function to set frame cluster ID

func Command

func Command(cmd [2]byte) func(interface{})

Command helper options function to set AT related frame command

func Data

func Data(data []byte) func(interface{})

Data helper options function to set frame data

func DstEP

func DstEP(dst byte) func(interface{})

DstEP helper options function to set frame destination endpoint

func FrameID

func FrameID(id byte) func(interface{})

FrameID helper options function to set frame ID

func Options

func Options(options byte) func(interface{})

Options helper options function to set frame options

func Parameter

func Parameter(parameter []byte) func(interface{})

Parameter helper options function to set frame parameter

func ProfileID

func ProfileID(id uint16) func(interface{})

ProfileID helper options function to set frame profile ID

func SrcEP

func SrcEP(src byte) func(interface{})

SrcEP helper options function to set frame source endpoint

Types

type APIFrame

type APIFrame struct {
	Mode api.EscapeMode
}

APIFrame defines an API frame structure

func New

func New(options ...func(interface{})) *APIFrame

New constructs a TX API frame

func (*APIFrame) Bytes

func (f *APIFrame) Bytes(frame Frame) ([]byte, error)

Bytes transforms a data frame into an API frame slice

func (*APIFrame) SetAPIEscapeMode

func (f *APIFrame) SetAPIEscapeMode(mode api.EscapeMode)

SetAPIEscapeMode satisfy APIEscapeModeSetter interface

type AT

type AT struct {
	FrameID   byte
	Cmd       [2]byte
	Parameter []byte
}

AT transmit frame

func NewAT

func NewAT(options ...func(interface{})) *AT

func (*AT) Bytes

func (f *AT) Bytes() ([]byte, error)

Bytes turn AT frame into bytes, satisfy Frame interface

func (*AT) SetCommand

func (f *AT) SetCommand(cmd [2]byte)

SetCommand satisfy CommandSetter interface

func (*AT) SetFrameID

func (f *AT) SetFrameID(id byte)

SetFrameID satisfy FrameIDSetter interface

func (*AT) SetParameter

func (f *AT) SetParameter(parameter []byte)

SetParameter satisfy ParameterSetter interface

type ATQueue

type ATQueue struct {
	FrameID   byte
	Cmd       [2]byte
	Parameter []byte
}

ATQueue queue transmit frame

func NewATQueue

func NewATQueue(options ...func(interface{})) *ATQueue

func (*ATQueue) Bytes

func (f *ATQueue) Bytes() ([]byte, error)

Bytes turn ATQueue frame into bytes, satisfy Frame interface

func (*ATQueue) SetCommand

func (f *ATQueue) SetCommand(cmd [2]byte)

SetCommand satisfy CommandSetter interface

func (*ATQueue) SetFrameID

func (f *ATQueue) SetFrameID(id byte)

SetFrameID satisfy FrameIDSetter interface

func (*ATQueue) SetParameter

func (f *ATQueue) SetParameter(parameter []byte)

SetParameter satisfy ParameterSetter interface

type ATRemote

type ATRemote struct {
	FrameID   byte
	Addr64    uint64
	Addr16    uint16
	Options   byte
	Cmd       [2]byte
	Parameter []byte
}

ATRemote AT remote transmit frame

func NewATRemote

func NewATRemote(options ...func(interface{})) *ATRemote

func (*ATRemote) Bytes

func (f *ATRemote) Bytes() ([]byte, error)

Bytes turn ATRemote frame into bytes, satisfy Frame interface

func (*ATRemote) SetAddr16

func (f *ATRemote) SetAddr16(addr uint16)

SetAddr16 satisfy Addr16Setter interface

func (*ATRemote) SetAddr64

func (f *ATRemote) SetAddr64(addr uint64)

SetAddr64 satisfy Addr64Setter interface

func (*ATRemote) SetCommand

func (f *ATRemote) SetCommand(cmd [2]byte)

SetCommand satisfy CommandSetter interface

func (*ATRemote) SetFrameID

func (f *ATRemote) SetFrameID(id byte)

SetFrameID satisfy FrameIDSetter interface

func (*ATRemote) SetOptions

func (f *ATRemote) SetOptions(options byte)

SetOptions satisfy OptionsSetter interface

func (*ATRemote) SetParameter

func (f *ATRemote) SetParameter(parameter []byte)

SetParameter satisfy ParameterSetter interface

type Addr16Setter

type Addr16Setter interface {
	SetAddr16(uint16)
}

Addr64Setter sets frame 16-bit address

type Addr64Setter

type Addr64Setter interface {
	SetAddr64(uint64)
}

Addr64Setter sets frame 64-bit address

type BroadcastRadiusSetter

type BroadcastRadiusSetter interface {
	SetBroadcastRadius(byte)
}

BroadcastRadiusSetter sets frame broadcast radius

type ClusterIDSetter

type ClusterIDSetter interface {
	SetClusterID(uint16)
}

ClusterIDSetter sets frame cluster ID

type CommandSetter

type CommandSetter interface {
	SetCommand([2]byte)
}

CommandSetter sets AT related frame command

type DataSetter

type DataSetter interface {
	SetData([]byte)
}

DataSetter sets frame data

type DstEPSetter

type DstEPSetter interface {
	SetDstEP(byte)
}

DstEPSetter sets frame destination endpoint

type Frame

type Frame interface {
	Bytes() ([]byte, error)
}

Frame interface for TX frames

type FrameIDSetter

type FrameIDSetter interface {
	SetFrameID(byte)
}

FrameIDSetter sets the frame ID

type OptionsSetter

type OptionsSetter interface {
	SetOptions(byte)
}

OptionsSetter sets frame options

type ParameterSetter

type ParameterSetter interface {
	SetParameter([]byte)
}

ParameterSetter sets frame parameters

type ProfileIDSetter

type ProfileIDSetter interface {
	SetProfileID(uint16)
}

ProfileIDSetter sets frame profile ID

type SrcEPSetter

type SrcEPSetter interface {
	SetSrcEP(byte)
}

SrcEPSetter sets frame source endpoint

type ZB

type ZB struct {
	FrameID         byte
	Addr64          uint64
	Addr16          uint16
	BroadcastRadius byte
	Options         byte
	Data            []byte
}

ZB transmit frame

func NewZB

func NewZB(options ...func(interface{})) *ZB

func (*ZB) Bytes

func (f *ZB) Bytes() ([]byte, error)

Bytes turn ZB frame into bytes, satisfy Frame interface

func (*ZB) SetAddr16

func (f *ZB) SetAddr16(addr uint16)

SetAddr16 satisfy Addr16Setter interface

func (*ZB) SetAddr64

func (f *ZB) SetAddr64(addr uint64)

SetAddr64 satisfy Addr64Setter interface

func (*ZB) SetBroadcastRadius

func (f *ZB) SetBroadcastRadius(hops byte)

SetBroadcastRadius satisfy BroadcastRadiusSetter interface

func (*ZB) SetData

func (f *ZB) SetData(data []byte)

SetData satisfy DataSetter interface

func (*ZB) SetFrameID

func (f *ZB) SetFrameID(id byte)

SetFrameID satisfy FrameIDSetter interface

func (*ZB) SetOptions

func (f *ZB) SetOptions(options byte)

SetOptions satisfy OptionsSetter interface

type ZBExplicit

type ZBExplicit struct {
	FrameID         byte
	Addr64          uint64
	Addr16          uint16
	SrcEP           byte
	DstEP           byte
	ClusterID       uint16
	ProfileID       uint16
	BroadcastRadius byte
	Options         byte
	Data            []byte
}

ZBExplicit transmit frame

func NewZBExplicit

func NewZBExplicit(options ...func(interface{})) *ZBExplicit

func (*ZBExplicit) Bytes

func (f *ZBExplicit) Bytes() ([]byte, error)

Bytes turn frame into bytes, satosfy Frame interface

func (*ZBExplicit) SetAddr16

func (f *ZBExplicit) SetAddr16(addr uint16)

SetAddr16 satisfy Addr16Setter interface

func (*ZBExplicit) SetAddr64

func (f *ZBExplicit) SetAddr64(addr uint64)

SetAddr64 satisfy Addr64Setter interface

func (*ZBExplicit) SetBroadcastRadius

func (f *ZBExplicit) SetBroadcastRadius(hops byte)

SetBroadcastRadius satisfy BroadcastRadiusSetter interface

func (*ZBExplicit) SetClusterID

func (f *ZBExplicit) SetClusterID(id uint16)

SetClusterID satisfy ClusterIDSetter interface

func (*ZBExplicit) SetData

func (f *ZBExplicit) SetData(data []byte)

SetData satisfy DataSetter interface

func (*ZBExplicit) SetDstEP

func (f *ZBExplicit) SetDstEP(dst byte)

SetDstEP satisfy DstEPSetter interface

func (*ZBExplicit) SetFrameID

func (f *ZBExplicit) SetFrameID(id byte)

SetFrameID satisfy FrameIDSetter interface

func (*ZBExplicit) SetOptions

func (f *ZBExplicit) SetOptions(options byte)

SetOptions satisfy OptionsSetter interface

func (*ZBExplicit) SetProfileID

func (f *ZBExplicit) SetProfileID(id uint16)

SetProfileID satisfy ProfileIDSetter interface

func (*ZBExplicit) SetSrcEP

func (f *ZBExplicit) SetSrcEP(src byte)

SetSrcEP satisfy SrcEPSetter interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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