zstack

package module
v0.0.0-...-df01c96 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: Apache-2.0 Imports: 18 Imported by: 1

README

Shimmering Bee: Z-Stack

license standard-readme compliant Actions Status

Implementation of a ZNP and support code designed to interface with Texas Instruments Z-Stack, written in Go.

Table of Contents

Background

Z-Stack is a Zigbee Stack made available by Texas Instruments for use on their CC 2.4Ghz SOC processors. This library implements a Zigbee Network Processor that is capable of controlling a Z-Stack implementation, specifically it supports the CC series of Zigbee sniffers flashed with the zigbee2mqtt Z-Stack coordinator firmware.

More information about Z-Stack is available from Texas Instruments directly or from Z-Stack Developer's Guide.

Another implementation of a Z-Stack compatible ZNP exists for Golang, it did hold no license for a period and the author could not be contacted. This has been rectified, so it may be of interest you. This is a complete reimplementation of the library, however it is likely there will be strong coincidences due to Golang standards.

Supported Devices

The following chips and sticks are known to work, though it's likely others in the series will too:

Huge thanks to @Koenkk for his work in providing Z-Stack firmware for these chips. You can grab the firmware from GitHub.

Install

Add an import and most IDEs will go get automatically, if it doesn't go build will fetch.

import "github.com/shimmeringbee/zstack"

Usage

This libraries API is unstable and should not yet be relied upon.

Open Serial Connection and Start ZStack
/* Obtain a ReadWriter UART interface to CC253X */
serialPort :=

/* Construct node table, cache of network nodes. */
t := zstack.NewNodeTable()

/* Create a new ZStack struct. */
z := zstack.New(serialPort, t)

/* Generate random Zigbee network, on default channel (15) */
netCfg, _ := zigbee.GenerateNetworkConfiguration()

/* Obtain context for timeout of initialisation. */
ctx, cancel := context.WithTimeout(context.Background(), 2 * time.Minute)
defer cancel()

/* Initialise ZStack and CC253X */)
err = z.Initialise(ctx, nc)
Handle Events

It is critical that this is handled until you wish to stop the Z-Stack instance.

for {
    ctx := context.Background()
    event, err := z.ReadEvent(ctx)

    if err != nil {
        return
    }

    switch e := event.(type) {
    case zigbee.NodeJoinEvent:
        log.Printf("join: %v\n", e.Node)
        go exploreDevice(z, e.Node)
    case zigbee.NodeLeaveEvent:
        log.Printf("leave: %v\n", e.Node)
    case zigbee.NodeUpdateEvent:
        log.Printf("update: %v\n", e.Node)
    case zigbee.NodeIncomingMessageEvent:
        log.Printf("message: %v\n", e)
    }
}
Permit Joins
err := z.PermitJoin(ctx, true)
Deny Joins
err := z.DenyJoin(ctx)
Query Device For Details
func exploreDevice(z *zstack.ZStack, node zigbee.Node) {
	log.Printf("node %v: querying", node.IEEEAddress)

	ctx, cancel := context.WithTimeout(context.Background(), 1 * time.Minute)
	defer cancel()

	descriptor, err := z.QueryNodeDescription(ctx, node.IEEEAddress)

	if err != nil {
		log.Printf("failed to get node descriptor: %v", err)
		return
	}

	log.Printf("node %v: descriptor: %+v", node.IEEEAddress, descriptor)

	endpoints, err := z.QueryNodeEndpoints(ctx, node.IEEEAddress)

	if err != nil {
		log.Printf("failed to get node endpoints: %v", err)
		return
	}

	log.Printf("node %v: endpoints: %+v", node.IEEEAddress, endpoints)

	for _, endpoint := range endpoints {
		endpointDes, err := z.QueryNodeEndpointDescription(ctx, node.IEEEAddress, endpoint)

		if err != nil {
			log.Printf("failed to get node endpoint description: %v / %d", err, endpoint)
		} else {
			log.Printf("node %v: endpoint: %d desc: %+v", node.IEEEAddress, endpoint, endpointDes)
		}
	}
}
Node Table Cache

zstack requires a NodeTable structure to cache a devices IEEE address to its Zibgee network address. A design decision for zstack was that all operations would reference the IEEE address. This cache must be persisted between program runs as the coordinator hardware does not retain this information between restarts.

// Create new table
nodeTable := NewNodeTable()

// Dump current content
nodes := nodeTable.Nodes()

// Load previous content - this should be done before starting ZStack.
nodeTable.Load(nodes)
ZCL

To handle ZCL messages you must handle zigbee.NodeIncomingMessageEvent messages and process the ZCL payload with the ZCL library, responses can be sent with z.SendNodeMessage.

Maintainers

@pwood

Contributing

Feel free to dive in! Open an issue or submit PRs.

All Shimmering Bee projects follow the Contributor Covenant Code of Conduct.

License

Copyright 2019-2020 Shimmering Bee Contributors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Index

Constants

View Source
const (
	JoiningOff uint8 = 0x00
	JoiningOn  uint8 = 0xff
)
View Source
const AFRegisterID uint8 = 0x00
View Source
const AFRegisterReplyID uint8 = 0x00
View Source
const APPCNFBDBSetChannelRequestID uint8 = 0x08
View Source
const APPCNFBDBSetChannelRequestReplyID uint8 = 0x08
View Source
const APPCNFBDBStartCommissioningRequestID uint8 = 0x05
View Source
const APPCNFBDBStartCommissioningRequestReplyID uint8 = 0x05
View Source
const AfDataConfirmID uint8 = 0x80
View Source
const AfDataRequestID uint8 = 0x01
View Source
const AfDataRequestReplyID uint8 = 0x01
View Source
const AfIncomingMsgID uint8 = 0x81
View Source
const DefaultInflightEvents = 50
View Source
const DefaultInflightTransactions = 20
View Source
const DefaultRadius uint8 = 0x20
View Source
const DefaultResolveIEEETimeout = 500 * time.Millisecond
View Source
const DefaultZStackRetries = 3
View Source
const DefaultZStackTimeout = 5 * time.Second
View Source
const SysOSALNVReadID uint8 = 0x08
View Source
const SysOSALNVReadReplyID uint8 = 0x08
View Source
const SysOSALNVWriteID uint8 = 0x09
View Source
const SysOSALNVWriteReplyID uint8 = 0x09
View Source
const SysResetIndID uint8 = 0x80
View Source
const SysResetReqID uint8 = 0x00
View Source
const UtilGetDeviceInfoRequestID uint8 = 0x00
View Source
const UtilGetDeviceInfoRequestReplyID uint8 = 0x00
View Source
const ZCDNVChanListID uint16 = 0x0084
View Source
const ZCDNVExtPANIDID uint16 = 0x002d
View Source
const ZCDNVLogicalTypeID uint16 = 0x0087
View Source
const ZCDNVPANIDID uint16 = 0x0083
View Source
const ZCDNVPreCfgKeyID uint16 = 0x0062
View Source
const ZCDNVPreCfgKeysEnableID uint16 = 0x0063
View Source
const ZCDNVSecurityModeID uint16 = 0x0064
View Source
const ZCDNVStartUpOptionID uint16 = 0x0003
View Source
const ZCDNVTCLKTableStartID uint16 = 0x0101
View Source
const ZCDNVUseDefaultTCLKID uint16 = 0x006d
View Source
const ZCDNVZDODirectCBID uint16 = 0x008f
View Source
const ZDOMgmtPermitJoinRequestID = 0x36
View Source
const ZDOMgmtPermitJoinRequestReplyID uint8 = 0x36
View Source
const ZDOStartUpFromAppRequestId uint8 = 0x40
View Source
const ZDOStartUpFromAppRequestReplyID uint8 = 0x40
View Source
const ZDOStateChangeIndID uint8 = 0xc0
View Source
const ZdoActiveEpReqID uint8 = 0x05
View Source
const ZdoActiveEpReqReplyID uint8 = 0x05
View Source
const ZdoActiveEpRspID uint8 = 0x85
View Source
const ZdoBindReqID uint8 = 0x21
View Source
const ZdoBindReqReplyID uint8 = 0x21
View Source
const ZdoBindRspID uint8 = 0xa1
View Source
const ZdoEndDeviceAnnceIndID uint8 = 0xc1
View Source
const ZdoIEEEAddrReqID uint8 = 0x01
View Source
const ZdoIEEEAddrReqReplyID uint8 = 0x01
View Source
const ZdoIEEEAddrRspID uint8 = 0x81
View Source
const ZdoLeaveIndID uint8 = 0xc9
View Source
const ZdoMGMTLQIReqID uint8 = 0x31
View Source
const ZdoMGMTLQIReqReplyID uint8 = 0x31
View Source
const ZdoMGMTLQIRspID uint8 = 0xb1
View Source
const ZdoMgmtLeaveReqID uint8 = 0x34
View Source
const ZdoMgmtLeaveReqReplyID uint8 = 0x34
View Source
const ZdoMgmtLeaveRspID uint8 = 0xb4
View Source
const ZdoNWKAddrReqID uint8 = 0x00
View Source
const ZdoNWKAddrReqReplyID uint8 = 0x00
View Source
const ZdoNWKAddrRspID uint8 = 0x80
View Source
const ZdoNodeDescReqID uint8 = 0x02
View Source
const ZdoNodeDescReqReplyID uint8 = 0x02
View Source
const ZdoNodeDescRspID uint8 = 0x82
View Source
const ZdoSimpleDescReqID uint8 = 0x04
View Source
const ZdoSimpleDescReqReplyID uint8 = 0x04
View Source
const ZdoSimpleDescRspID uint8 = 0x84
View Source
const ZdoTcDevIndID uint8 = 0xca
View Source
const ZdoUnbindReqID uint8 = 0x22
View Source
const ZdoUnbindReqReplyID uint8 = 0x22
View Source
const ZdoUnbindRspID uint8 = 0xa2

Variables

View Source
var ErrorZFailure = errors.New("ZStack has returned a failure")
View Source
var NVRAMUnrecognised = errors.New("nvram structure unrecognised")
View Source
var NVRAMUnsuccessful = errors.New("nvram operation unsuccessful")
View Source
var NodeResponseWasNotSuccess = errors.New("response from node was not success")
View Source
var ReplyDoesNotReportSuccess = errors.New("reply struct does not support Successor interface")

Functions

func AnyResponse

func AnyResponse(v interface{}) bool

Types

type AFRegister

type AFRegister struct {
	Endpoint         zigbee.Endpoint
	AppProfileId     zigbee.ProfileID
	AppDeviceId      uint16
	AppDeviceVersion uint8
	LatencyReq       uint8
	AppInClusters    []zigbee.ClusterID `bcsliceprefix:"8"`
	AppOutClusters   []zigbee.ClusterID `bcsliceprefix:"8"`
}

type AFRegisterReply

type AFRegisterReply GenericZStackStatus

type APPCNFBDBSetChannelRequest

type APPCNFBDBSetChannelRequest struct {
	IsPrimary bool `bcwidth:"8"`
	Channel   [4]byte
}

type APPCNFBDBSetChannelRequestReply

type APPCNFBDBSetChannelRequestReply GenericZStackStatus

type APPCNFBDBStartCommissioningRequest

type APPCNFBDBStartCommissioningRequest struct {
	Mode uint8
}

type APPCNFBDBStartCommissioningRequestReply

type APPCNFBDBStartCommissioningRequestReply GenericZStackStatus

type AfDataConfirm

type AfDataConfirm struct {
	Status        ZStackStatus
	Endpoint      zigbee.Endpoint
	TransactionID uint8
}

func (AfDataConfirm) WasSuccessful

func (s AfDataConfirm) WasSuccessful() bool

type AfDataRequest

type AfDataRequest struct {
	DestinationAddress  zigbee.NetworkAddress
	DestinationEndpoint zigbee.Endpoint
	SourceEndpoint      zigbee.Endpoint
	ClusterID           zigbee.ClusterID
	TransactionID       uint8
	Options             AfDataRequestOptions
	Radius              uint8
	Data                []byte `bcsliceprefix:"8"`
}

type AfDataRequestOptions

type AfDataRequestOptions struct {
	Reserved0      uint8 `bcfieldwidth:"1"`
	EnableSecurity bool  `bcfieldwidth:"1"`
	DiscoveryRoute bool  `bcfieldwidth:"1"`
	ACKRequest     bool  `bcfieldwidth:"1"`
	Reserved1      uint8 `bcfieldwidth:"4"`
}

type AfDataRequestReply

type AfDataRequestReply GenericZStackStatus

func (AfDataRequestReply) WasSuccessful

func (s AfDataRequestReply) WasSuccessful() bool

type AfIncomingMsg

type AfIncomingMsg struct {
	GroupID             zigbee.GroupID
	ClusterID           zigbee.ClusterID
	SourceAddress       zigbee.NetworkAddress
	SourceEndpoint      zigbee.Endpoint
	DestinationEndpoint zigbee.Endpoint
	WasBroadcast        bool
	LinkQuality         uint8
	SecurityUse         bool
	TimeStamp           uint32
	Sequence            uint8
	Data                []byte `bcsliceprefix:"8"`
}

type Awaiter

type Awaiter interface {
	Await(ctx context.Context, resp interface{}) error
}

type GenericZStackStatus

type GenericZStackStatus struct {
	Status ZStackStatus
}

func (GenericZStackStatus) WasSuccessful

func (s GenericZStackStatus) WasSuccessful() bool

type JoinState

type JoinState uint8
const (
	Off           JoinState = 0x00
	OnCoordinator JoinState = 0x01
	OnAllRouters  JoinState = 0x02
)

type NetworkProperties

type NetworkProperties struct {
	NetworkAddress zigbee.NetworkAddress
	IEEEAddress    zigbee.IEEEAddress
	PANID          zigbee.PANID
	ExtendedPANID  zigbee.ExtendedPANID
	NetworkKey     zigbee.NetworkKey
	Channel        uint8
	JoinState      JoinState
}

type NodeTable

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

func NewNodeTable

func NewNodeTable() *NodeTable

func (*NodeTable) Load

func (t *NodeTable) Load(nodes []zigbee.Node)

func (*NodeTable) Nodes

func (t *NodeTable) Nodes() []zigbee.Node

type RequestResponder

type RequestResponder interface {
	RequestResponse(ctx context.Context, req interface{}, resp interface{}) error
}

type ResetReason

type ResetReason uint8
const (
	PowerUp  ResetReason = 0
	External ResetReason = 1
	Watchdog ResetReason = 2
)

type ResetType

type ResetType uint8
const (
	Hard ResetType = 0
	Soft ResetType = 1
)

type Subscriber

type Subscriber interface {
	Subscribe(message interface{}, callback func(v interface{})) (error, func())
}

type Successor

type Successor interface {
	WasSuccessful() bool
}

type SysOSALNVRead

type SysOSALNVRead struct {
	NVItemID uint16
	Offset   uint8
}

type SysOSALNVReadReply

type SysOSALNVReadReply struct {
	Status ZStackStatus
	Value  []byte `bcsliceprefix:"8"`
}

type SysOSALNVWrite

type SysOSALNVWrite struct {
	NVItemID uint16
	Offset   uint8
	Value    []byte `bcsliceprefix:"8"`
}

type SysOSALNVWriteReply

type SysOSALNVWriteReply GenericZStackStatus

type SysResetInd

type SysResetInd struct {
	Reason  ResetReason
	Version Version
}

type SysResetReq

type SysResetReq struct {
	ResetType ResetType
}

type UtilGetDeviceInfoRequest

type UtilGetDeviceInfoRequest struct{}

type UtilGetDeviceInfoRequestReply

type UtilGetDeviceInfoRequestReply struct {
	Status         uint8
	IEEEAddress    zigbee.IEEEAddress
	NetworkAddress zigbee.NetworkAddress
}

type Version

type Version struct {
	TransportRevision uint8
	ProductID         uint8
	MajorRelease      uint8
	MinorRelease      uint8
	HardwareRevision  uint8
}

func (Version) IsV3

func (v Version) IsV3() bool

type ZBStartStatus

type ZBStartStatus uint8
const (
	ZBSuccess ZBStartStatus = 0x00
	ZBInit    ZBStartStatus = 0x22
)

type ZCDNVChanList

type ZCDNVChanList struct {
	Channels [4]byte
}

type ZCDNVExtPANID

type ZCDNVExtPANID struct {
	ExtendedPANID zigbee.ExtendedPANID
}

type ZCDNVLogicalType

type ZCDNVLogicalType struct {
	LogicalType zigbee.LogicalType
}

type ZCDNVPANID

type ZCDNVPANID struct {
	PANID zigbee.PANID
}

type ZCDNVPreCfgKey

type ZCDNVPreCfgKey struct {
	NetworkKey zigbee.NetworkKey
}

type ZCDNVPreCfgKeysEnable

type ZCDNVPreCfgKeysEnable struct {
	Enabled uint8
}

type ZCDNVSecurityMode

type ZCDNVSecurityMode struct {
	Enabled uint8
}

type ZCDNVStartUpOption

type ZCDNVStartUpOption struct {
	StartOption uint8
}

type ZCDNVTCLKTableStart

type ZCDNVTCLKTableStart struct {
	Address        zigbee.IEEEAddress
	NetworkKey     zigbee.NetworkKey
	TXFrameCounter uint32
	RXFrameCounter uint32
}

type ZCDNVUseDefaultTCLK

type ZCDNVUseDefaultTCLK struct {
	Enabled uint8
}

type ZCDNVZDODirectCB

type ZCDNVZDODirectCB struct {
	Enabled uint8
}

type ZDOMgmtPermitJoinRequest

type ZDOMgmtPermitJoinRequest struct {
	Destination    zigbee.NetworkAddress
	Duration       uint8
	TCSignificance uint8
}

type ZDOMgmtPermitJoinRequestReply

type ZDOMgmtPermitJoinRequestReply GenericZStackStatus

type ZDOStartUpFromAppRequest

type ZDOStartUpFromAppRequest struct {
	StartDelay uint16
}

type ZDOStartUpFromAppRequestReply

type ZDOStartUpFromAppRequestReply struct {
	Status uint8
}

type ZDOState

type ZDOState uint8
const (
	DeviceCoordinatorStarting ZDOState = 0x08
	DeviceZBCoordinator       ZDOState = 0x09
)

type ZDOStateChangeInd

type ZDOStateChangeInd struct {
	State ZDOState
}

type ZStack

type ZStack struct {
	NetworkProperties NetworkProperties
	// contains filtered or unexported fields
}

func New

func New(uart io.ReadWriter, nodeTable *NodeTable) *ZStack

func (*ZStack) AdapterNode

func (z *ZStack) AdapterNode() zigbee.Node

func (*ZStack) BindNodeToController

func (z *ZStack) BindNodeToController(ctx context.Context, nodeAddress zigbee.IEEEAddress, sourceEndpoint zigbee.Endpoint, destinationEndpoint zigbee.Endpoint, cluster zigbee.ClusterID) error

func (*ZStack) DenyJoin

func (z *ZStack) DenyJoin(ctx context.Context) error

func (*ZStack) ForceNodeLeave

func (z *ZStack) ForceNodeLeave(ctx context.Context, nodeAddress zigbee.IEEEAddress) error

func (*ZStack) GetAdapterIEEEAddress

func (z *ZStack) GetAdapterIEEEAddress(ctx context.Context) (zigbee.IEEEAddress, error)

func (*ZStack) GetAdapterNetworkAddress

func (z *ZStack) GetAdapterNetworkAddress(ctx context.Context) (zigbee.NetworkAddress, error)

func (*ZStack) Initialise

func (z *ZStack) Initialise(pctx context.Context, nc zigbee.NetworkConfiguration) error

func (*ZStack) PermitJoin

func (z *ZStack) PermitJoin(ctx context.Context, allRouters bool) error

func (*ZStack) QueryNodeDescription

func (z *ZStack) QueryNodeDescription(ctx context.Context, ieeeAddress zigbee.IEEEAddress) (zigbee.NodeDescription, error)

func (*ZStack) QueryNodeEndpointDescription

func (z *ZStack) QueryNodeEndpointDescription(ctx context.Context, ieeeAddress zigbee.IEEEAddress, endpoint zigbee.Endpoint) (zigbee.EndpointDescription, error)

func (*ZStack) QueryNodeEndpoints

func (z *ZStack) QueryNodeEndpoints(ctx context.Context, ieeeAddress zigbee.IEEEAddress) ([]zigbee.Endpoint, error)

func (*ZStack) QueryNodeIEEEAddress

func (z *ZStack) QueryNodeIEEEAddress(ctx context.Context, address zigbee.NetworkAddress) (zigbee.IEEEAddress, error)

func (*ZStack) QueryNodeNWKAddress

func (z *ZStack) QueryNodeNWKAddress(ctx context.Context, address zigbee.IEEEAddress) (zigbee.NetworkAddress, error)

func (*ZStack) ReadEvent

func (z *ZStack) ReadEvent(ctx context.Context) (interface{}, error)

func (*ZStack) RegisterAdapterEndpoint

func (z *ZStack) RegisterAdapterEndpoint(ctx context.Context, endpoint zigbee.Endpoint, appProfileId zigbee.ProfileID, appDeviceId uint16, appDeviceVersion uint8, inClusters []zigbee.ClusterID, outClusters []zigbee.ClusterID) error

func (*ZStack) RequestNodeLeave

func (z *ZStack) RequestNodeLeave(ctx context.Context, nodeAddress zigbee.IEEEAddress) error

func (*ZStack) ResolveNodeIEEEAddress

func (z *ZStack) ResolveNodeIEEEAddress(ctx context.Context, address zigbee.NetworkAddress) (zigbee.IEEEAddress, error)

func (*ZStack) ResolveNodeNWKAddress

func (z *ZStack) ResolveNodeNWKAddress(ctx context.Context, address zigbee.IEEEAddress) (zigbee.NetworkAddress, error)

func (*ZStack) SendApplicationMessageToNode

func (z *ZStack) SendApplicationMessageToNode(ctx context.Context, destinationAddress zigbee.IEEEAddress, message zigbee.ApplicationMessage, requireAck bool) error

func (*ZStack) Stop

func (z *ZStack) Stop()

func (*ZStack) UnbindNodeFromController

func (z *ZStack) UnbindNodeFromController(ctx context.Context, nodeAddress zigbee.IEEEAddress, sourceEndpoint zigbee.Endpoint, destinationEndpoint zigbee.Endpoint, cluster zigbee.ClusterID) error

func (*ZStack) WithGoLogger

func (z *ZStack) WithGoLogger(parentLogger *log.Logger)

func (*ZStack) WithLogWrapLogger

func (z *ZStack) WithLogWrapLogger(parentLogger logwrap.Logger)

type ZStackStatus

type ZStackStatus uint8
const (
	ZSuccess ZStackStatus = 0x00
	ZFailure ZStackStatus = 0x01
)

type ZdoActiveEpReq

type ZdoActiveEpReq struct {
	DestinationAddress zigbee.NetworkAddress
	OfInterestAddress  zigbee.NetworkAddress
}

type ZdoActiveEpReqReply

type ZdoActiveEpReqReply GenericZStackStatus

func (ZdoActiveEpReqReply) WasSuccessful

func (r ZdoActiveEpReqReply) WasSuccessful() bool

type ZdoActiveEpRsp

type ZdoActiveEpRsp struct {
	SourceAddress     zigbee.NetworkAddress
	Status            ZStackStatus
	OfInterestAddress zigbee.NetworkAddress
	ActiveEndpoints   []zigbee.Endpoint `bcsliceprefix:"8"`
}

func (ZdoActiveEpRsp) WasSuccessful

func (r ZdoActiveEpRsp) WasSuccessful() bool

type ZdoBindReq

type ZdoBindReq struct {
	TargetAddress          zigbee.NetworkAddress
	SourceAddress          zigbee.IEEEAddress
	SourceEndpoint         zigbee.Endpoint
	ClusterID              zigbee.ClusterID
	DestinationAddressMode uint8
	DestinationAddress     uint64
	DestinationEndpoint    zigbee.Endpoint
}

type ZdoBindReqReply

type ZdoBindReqReply GenericZStackStatus

func (ZdoBindReqReply) WasSuccessful

func (r ZdoBindReqReply) WasSuccessful() bool

type ZdoBindRsp

type ZdoBindRsp struct {
	SourceAddress zigbee.NetworkAddress
	Status        ZStackStatus
}

func (ZdoBindRsp) WasSuccessful

func (r ZdoBindRsp) WasSuccessful() bool

type ZdoEndDeviceAnnceInd

type ZdoEndDeviceAnnceInd struct {
	SourceAddress  zigbee.NetworkAddress
	NetworkAddress zigbee.NetworkAddress
	IEEEAddress    zigbee.IEEEAddress
	Capabilities   ZdoEndDeviceAnnceIndCapabilities
}

type ZdoEndDeviceAnnceIndCapabilities

type ZdoEndDeviceAnnceIndCapabilities struct {
	AddressAllocated   bool  `bcfieldwidth:"1"`
	SecurityCapability bool  `bcfieldwidth:"1"`
	Reserved           uint8 `bcfieldwidth:"2"`
	ReceiveOnIdle      bool  `bcfieldwidth:"1"`
	PowerSource        bool  `bcfieldwidth:"1"`
	Router             bool  `bcfieldwidth:"1"`
	AltPANController   bool  `bcfieldwidth:"1"`
}

type ZdoIEEEAddrReq

type ZdoIEEEAddrReq struct {
	NetworkAddress zigbee.NetworkAddress
	ReqType        uint8
	StartIndex     uint8
}

type ZdoIEEEAddrReqReply

type ZdoIEEEAddrReqReply GenericZStackStatus

func (ZdoIEEEAddrReqReply) WasSuccessful

func (s ZdoIEEEAddrReqReply) WasSuccessful() bool

type ZdoIEEEAddrRsp

type ZdoIEEEAddrRsp struct {
	Status            ZStackStatus
	IEEEAddress       zigbee.IEEEAddress
	NetworkAddress    zigbee.NetworkAddress
	StartIndex        uint8
	AssociatedDevices []zigbee.NetworkAddress `bcsliceprefix:"8"`
}

func (ZdoIEEEAddrRsp) WasSuccessful

func (s ZdoIEEEAddrRsp) WasSuccessful() bool

type ZdoLeaveInd

type ZdoLeaveInd struct {
	SourceAddress zigbee.NetworkAddress
	IEEEAddress   zigbee.IEEEAddress
	Request       bool
	Remove        bool
	Rejoin        bool
}

type ZdoMGMTLQINeighbour

type ZdoMGMTLQINeighbour struct {
	ExtendedPANID  zigbee.ExtendedPANID
	IEEEAddress    zigbee.IEEEAddress
	NetworkAddress zigbee.NetworkAddress
	Status         ZdoMGMTLQINeighbourStatus
	PermitJoining  bool
	Depth          uint8
	LQI            uint8
}

type ZdoMGMTLQINeighbourStatus

type ZdoMGMTLQINeighbourStatus struct {
	Reserved     uint8               `bcfieldwidth:"1"`
	Relationship zigbee.Relationship `bcfieldwidth:"3"`
	RxOnWhenIdle uint8               `bcfieldwidth:"2"`
	DeviceType   zigbee.LogicalType  `bcfieldwidth:"2"`
}

type ZdoMGMTLQIReq

type ZdoMGMTLQIReq struct {
	DestinationAddress zigbee.NetworkAddress
	StartIndex         uint8
}

type ZdoMGMTLQIReqReply

type ZdoMGMTLQIReqReply GenericZStackStatus

type ZdoMGMTLQIRsp

type ZdoMGMTLQIRsp struct {
	SourceAddress         zigbee.NetworkAddress
	Status                ZStackStatus
	NeighbourTableEntries uint8
	StartIndex            uint8
	Neighbors             []ZdoMGMTLQINeighbour `bcsliceprefix:"8"`
}

type ZdoMgmtLeaveReq

type ZdoMgmtLeaveReq struct {
	NetworkAddress zigbee.NetworkAddress
	IEEEAddress    zigbee.IEEEAddress
	RemoveChildren bool
}

type ZdoMgmtLeaveReqReply

type ZdoMgmtLeaveReqReply GenericZStackStatus

func (ZdoMgmtLeaveReqReply) WasSuccessful

func (r ZdoMgmtLeaveReqReply) WasSuccessful() bool

type ZdoMgmtLeaveRsp

type ZdoMgmtLeaveRsp struct {
	SourceAddress zigbee.NetworkAddress
	Status        ZStackStatus
}

func (ZdoMgmtLeaveRsp) WasSuccessful

func (r ZdoMgmtLeaveRsp) WasSuccessful() bool

type ZdoNWKAddrReq

type ZdoNWKAddrReq struct {
	IEEEAddress zigbee.IEEEAddress
	ReqType     uint8
	StartIndex  uint8
}

type ZdoNWKAddrReqReply

type ZdoNWKAddrReqReply GenericZStackStatus

func (ZdoNWKAddrReqReply) WasSuccessful

func (s ZdoNWKAddrReqReply) WasSuccessful() bool

type ZdoNWKAddrRsp

type ZdoNWKAddrRsp struct {
	Status            ZStackStatus
	IEEEAddress       zigbee.IEEEAddress
	NetworkAddress    zigbee.NetworkAddress
	StartIndex        uint8
	AssociatedDevices []zigbee.NetworkAddress `bcsliceprefix:"8"`
}

func (ZdoNWKAddrRsp) WasSuccessful

func (s ZdoNWKAddrRsp) WasSuccessful() bool

type ZdoNodeDescReq

type ZdoNodeDescReq struct {
	DestinationAddress zigbee.NetworkAddress
	OfInterestAddress  zigbee.NetworkAddress
}

type ZdoNodeDescReqReply

type ZdoNodeDescReqReply GenericZStackStatus

func (ZdoNodeDescReqReply) WasSuccessful

func (r ZdoNodeDescReqReply) WasSuccessful() bool

type ZdoNodeDescRsp

type ZdoNodeDescRsp struct {
	SourceAddress          zigbee.NetworkAddress
	Status                 ZStackStatus
	OfInterestAddress      zigbee.NetworkAddress
	Capabilities           ZdoNodeDescRspCapabilities
	NodeFrequencyBand      uint8 `bcfieldwidth:"3"`
	APSFlags               uint8 `bcfieldwidth:"5"`
	MacCapabilitiesFlags   uint8
	ManufacturerCode       uint16
	MaxBufferSize          uint8
	MaxInTransferSize      uint16
	ServerMask             ZdoNodeDescRspServerMask
	MaxOutTransferSize     uint16
	DescriptorCapabilities uint8
}

func (ZdoNodeDescRsp) WasSuccessful

func (r ZdoNodeDescRsp) WasSuccessful() bool

type ZdoNodeDescRspCapabilities

type ZdoNodeDescRspCapabilities struct {
	Reserved                   uint8              `bcfieldwidth:"3"`
	UserDescriptorAvailable    bool               `bcfieldwidth:"1"`
	ComplexDescriptorAvailable bool               `bcfieldwidth:"1"`
	LogicalType                zigbee.LogicalType `bcfieldwidth:"3"`
}

type ZdoNodeDescRspServerMask

type ZdoNodeDescRspServerMask struct {
	Reserved0                uint8 `bcfieldwidth:"8"`
	Reserved1                uint8 `bcfieldwidth:"2"`
	BackupDiscoveryCache     bool  `bcfieldwidth:"1"`
	PrimaryDiscoveryCache    bool  `bcfieldwidth:"1"`
	BackupBindingTableCache  bool  `bcfieldwidth:"1"`
	PrimaryBindingTableCache bool  `bcfieldwidth:"1"`
	BackupTrustCenter        bool  `bcfieldwidth:"1"`
	PrimaryTrustCenter       bool  `bcfieldwidth:"1"`
}

type ZdoSimpleDescReq

type ZdoSimpleDescReq struct {
	DestinationAddress zigbee.NetworkAddress
	OfInterestAddress  zigbee.NetworkAddress
	Endpoint           zigbee.Endpoint
}

type ZdoSimpleDescReqReply

type ZdoSimpleDescReqReply GenericZStackStatus

func (ZdoSimpleDescReqReply) WasSuccessful

func (r ZdoSimpleDescReqReply) WasSuccessful() bool

type ZdoSimpleDescRsp

type ZdoSimpleDescRsp struct {
	SourceAddress     zigbee.NetworkAddress
	Status            ZStackStatus
	OfInterestAddress zigbee.NetworkAddress
	Length            uint8
	Endpoint          zigbee.Endpoint
	ProfileID         zigbee.ProfileID
	DeviceID          uint16
	DeviceVersion     uint8
	InClusterList     []zigbee.ClusterID `bcsliceprefix:"8"`
	OutClusterList    []zigbee.ClusterID `bcsliceprefix:"8"`
}

func (ZdoSimpleDescRsp) WasSuccessful

func (r ZdoSimpleDescRsp) WasSuccessful() bool

type ZdoTcDevInd

type ZdoTcDevInd struct {
	NetworkAddress zigbee.NetworkAddress
	IEEEAddress    zigbee.IEEEAddress
	ParentAddress  zigbee.NetworkAddress
}

type ZdoUnbindReq

type ZdoUnbindReq struct {
	TargetAddress          zigbee.NetworkAddress
	SourceAddress          zigbee.IEEEAddress
	SourceEndpoint         zigbee.Endpoint
	ClusterID              zigbee.ClusterID
	DestinationAddressMode uint8
	DestinationAddress     uint64
	DestinationEndpoint    zigbee.Endpoint
}

type ZdoUnbindReqReply

type ZdoUnbindReqReply GenericZStackStatus

func (ZdoUnbindReqReply) WasSuccessful

func (r ZdoUnbindReqReply) WasSuccessful() bool

type ZdoUnbindRsp

type ZdoUnbindRsp struct {
	SourceAddress zigbee.NetworkAddress
	Status        ZStackStatus
}

func (ZdoUnbindRsp) WasSuccessful

func (r ZdoUnbindRsp) WasSuccessful() bool

Jump to

Keyboard shortcuts

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