zigbee

package module
v0.0.0-...-61eaf48 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 11 Imported by: 0

README

Go ZigBee

A golang library for interacting with a ZigBee network using TI's Z-Stack Linux Gateway.

It is used by the Ninja Sphere in https://github.com/ninjasphere/driver-go-zigbee which can also be used as example code until we have expanded this documentation.

License

Copyright 2014 Ninja Blocks, Inc. All rights reserved.

Licensed under the MIT License

The .proto files are Copyright 2013 Texas Instruments Incorporated. All rights reserved.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(logger *logger.Logger)

Types

type ZStackGateway

type ZStackGateway struct {
	*ZStackServer
	// contains filtered or unexported fields
}

func ConnectToGatewayServer

func ConnectToGatewayServer(hostname string, port int) (*ZStackGateway, error)

func (*ZStackGateway) OnBoundCluster

func (s *ZStackGateway) OnBoundCluster(addr uint64, endpoint uint32, cluster uint32) chan *gateway.GwZclFrameReceiveInd

func (*ZStackGateway) OnZoneState

func (s *ZStackGateway) OnZoneState(addr uint64, endpoint uint32) chan *gateway.DevZoneStatusChangeInd

func (*ZStackGateway) SendAsyncCommand

func (s *ZStackGateway) SendAsyncCommand(request zStackGatewayCommand, response zStackGatewayCommand, timeout time.Duration) error

SendAsyncCommand sends a command that requires an async response from the device, using ZCL SequenceNumber

func (*ZStackGateway) SendCommand

func (s *ZStackGateway) SendCommand(request zStackGatewayCommand, response zStackGatewayCommand) error

SendCommand sends a protobuf Message to the Z-Stack server, and waits for the response

type ZStackNwkMgr

type ZStackNwkMgr struct {
	*ZStackServer

	OnDeviceFound  func(deviceInfo *nwkmgr.NwkDeviceInfoT)
	OnNetworkReady func()
	// contains filtered or unexported fields
}

func ConnectToNwkMgrServer

func ConnectToNwkMgrServer(hostname string, port int) (*ZStackNwkMgr, error)

func (*ZStackNwkMgr) FetchDeviceList

func (d *ZStackNwkMgr) FetchDeviceList() error

func (*ZStackNwkMgr) Reset

func (s *ZStackNwkMgr) Reset(hard bool) error

func (*ZStackNwkMgr) SendAsyncCommand

func (s *ZStackNwkMgr) SendAsyncCommand(request zStackNwkMgrCommand, response zStackNwkMgrCommand, timeout time.Duration) error

SendAsyncCommand sends a command that requires an async response from the device, using ZCL SequenceNumber

func (*ZStackNwkMgr) SendCommand

func (s *ZStackNwkMgr) SendCommand(request zStackNwkMgrCommand, response zStackNwkMgrCommand) error

SendCommand sends a protobuf Message to the Z-Stack server, and waits for the response

type ZStackOta

type ZStackOta struct {
	*ZStackServer
}

func ConnectToOtaServer

func ConnectToOtaServer(hostname string, port int) (*ZStackOta, error)

func (*ZStackOta) SendCommand

func (s *ZStackOta) SendCommand(request zStackOtaCommand, response zStackOtaCommand) error

SendCommand sends a protobuf Message to the Z-Stack OTA server, and waits for the response

type ZStackServer

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

ZStackServer holds the connection to one of the Z-Stack servers (nwkmgr, gateway and otasrvr)

Directories

Path Synopsis
Package gateway is a generated protocol buffer package.
Package gateway is a generated protocol buffer package.
Package nwkmgr is a generated protocol buffer package.
Package nwkmgr is a generated protocol buffer package.
Package otasrvr is a generated protocol buffer package.
Package otasrvr is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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