zcl

package module
v0.0.0-...-4eee02c Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 7 Imported by: 13

README

Shimmering Bee: Zigbee Cluster Library

license standard-readme compliant Actions Status

Implementation of common Zigbee Cluster Library for marshaling and unmarshaling messages, written in Go.

Table of Contents

Background

ZCL is an implementation of some parts of the Zigbee Cluster Library, used within the Shimmering Bee suite of applications.

Install

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

import "github.com/shimmeringbee/zcl"

Usage

This library's API is unstable and should not yet be relied upon.

This piece of software is not ready for general use.

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 (
	BasicId                                   = zigbee.ClusterID(0x0000)
	PowerConfigurationId                      = zigbee.ClusterID(0x0001)
	DeviceTemperatureConfigurationId          = zigbee.ClusterID(0x0002)
	IdentifyId                                = zigbee.ClusterID(0x0003)
	GroupsId                                  = zigbee.ClusterID(0x0004)
	ScenesId                                  = zigbee.ClusterID(0x0005)
	OnOffId                                   = zigbee.ClusterID(0x0006)
	OnOffSwitchConfigurationId                = zigbee.ClusterID(0x0007)
	LevelControlId                            = zigbee.ClusterID(0x0008)
	AlarmsId                                  = zigbee.ClusterID(0x0009)
	TimeId                                    = zigbee.ClusterID(0x000a)
	RSSILocationId                            = zigbee.ClusterID(0x000b)
	AnalogInputBasicId                        = zigbee.ClusterID(0x000c)
	AnalogOutputBasicId                       = zigbee.ClusterID(0x000d)
	AnalogValveBasicId                        = zigbee.ClusterID(0x000e)
	BinaryInputBasicId                        = zigbee.ClusterID(0x000f)
	BinaryOutputBasicId                       = zigbee.ClusterID(0x0010)
	BinaryValueBasicId                        = zigbee.ClusterID(0x0011)
	MultistateInputBasicId                    = zigbee.ClusterID(0x0012)
	MultistateOutputBasicId                   = zigbee.ClusterID(0x0013)
	MultistateValueBasicId                    = zigbee.ClusterID(0x0014)
	CommissioningId                           = zigbee.ClusterID(0x0015)
	PartitionId                               = zigbee.ClusterID(0x0016)
	OTAUpgradeId                              = zigbee.ClusterID(0x0019)
	PowerProfileId                            = zigbee.ClusterID(0x001a)
	EN50523ApplianceControlId                 = zigbee.ClusterID(0x001b)
	PulseWidthModulationId                    = zigbee.ClusterID(0x001c)
	PollControlId                             = zigbee.ClusterID(0x0020)
	MobileDeviceConfigurationClusterId        = zigbee.ClusterID(0x0022)
	NeighborCleaningClusterId                 = zigbee.ClusterID(0x0023)
	NearestGatewayClusterId                   = zigbee.ClusterID(0x0024)
	KeepAliveId                               = zigbee.ClusterID(0x0025)
	ShadeConfigurationId                      = zigbee.ClusterID(0x0100)
	DoorLockId                                = zigbee.ClusterID(0x0101)
	WindowCoveringId                          = zigbee.ClusterID(0x0102)
	PumpConfigurationAndControlId             = zigbee.ClusterID(0x0200)
	ThermostatId                              = zigbee.ClusterID(0x0201)
	FanControlId                              = zigbee.ClusterID(0x0202)
	DehumidificationControlId                 = zigbee.ClusterID(0x0203)
	ThermostatUserInterfaceConfigurationId    = zigbee.ClusterID(0x0204)
	ColorControlId                            = zigbee.ClusterID(0x0300)
	BallastConfigurationId                    = zigbee.ClusterID(0x0301)
	IlluminanceMeasurementId                  = zigbee.ClusterID(0x0400)
	IlluminanceLevelSensingId                 = zigbee.ClusterID(0x0401)
	TemperatureMeasurementId                  = zigbee.ClusterID(0x0402)
	PressureMeasurementId                     = zigbee.ClusterID(0x0403)
	FlowMeasurementId                         = zigbee.ClusterID(0x0404)
	RelativeHumidityMeasurementId             = zigbee.ClusterID(0x0405)
	OccupancySensingId                        = zigbee.ClusterID(0x0406)
	LeafWetnessId                             = zigbee.ClusterID(0x0407)
	SoilMoistureId                            = zigbee.ClusterID(0x0408)
	PHMeasurementId                           = zigbee.ClusterID(0x0409)
	ElectricalConductivityId                  = zigbee.ClusterID(0x040a)
	WindSpeedMeasurementId                    = zigbee.ClusterID(0x040b)
	AirConcentrationCarbonMonoxideId          = zigbee.ClusterID(0x040c)
	AirConcentrationCarbonDioxideId           = zigbee.ClusterID(0x040d)
	AirConcentrationEthyleneId                = zigbee.ClusterID(0x040e)
	AirConcentrationEthyleneOxideId           = zigbee.ClusterID(0x040f)
	AirConcentrationHydrogenId                = zigbee.ClusterID(0x0410)
	AirConcentrationHydrogenSulfideId         = zigbee.ClusterID(0x0411)
	AirConcentrationNitricOxideId             = zigbee.ClusterID(0x0412)
	AirConcentrationNitrogenDioxideId         = zigbee.ClusterID(0x0413)
	AirConcentrationOxygenId                  = zigbee.ClusterID(0x0414)
	AirConcentrationOzoneId                   = zigbee.ClusterID(0x0415)
	AirConcentrationSulfurDioxideId           = zigbee.ClusterID(0x0416)
	WaterConcentrationDissolvedOxygenId       = zigbee.ClusterID(0x0417)
	WaterConcentrationBromateId               = zigbee.ClusterID(0x0418)
	WaterConcentrationChloraminesId           = zigbee.ClusterID(0x0419)
	WaterConcentrationChlorineId              = zigbee.ClusterID(0x041a)
	WaterConcentrationFecalcoliformEColiId    = zigbee.ClusterID(0x041b)
	WaterConcentrationFluorideId              = zigbee.ClusterID(0x041c)
	WaterConcentrationHaloaceticAcidsId       = zigbee.ClusterID(0x041d)
	WaterConcentrationTotalTrihalomethanesId  = zigbee.ClusterID(0x041e)
	WaterConcentrationTotalColiformBacteriaId = zigbee.ClusterID(0x041f)
	WaterConcentrationTurbidityId             = zigbee.ClusterID(0x0420)
	WaterConcentrationCopperId                = zigbee.ClusterID(0x0421)
	WaterConcentrationLeadId                  = zigbee.ClusterID(0x0422)
	WaterConcentrationManganeseId             = zigbee.ClusterID(0x0423)
	WaterConcentrationSulfateId               = zigbee.ClusterID(0x0424)
	WaterConcentrationBromodichloromethaneId  = zigbee.ClusterID(0x0425)
	WaterConcentrationBromoformId             = zigbee.ClusterID(0x0426)
	WaterConcentrationChlorodibromomethaneId  = zigbee.ClusterID(0x0427)
	WaterConcentrationChloroformId            = zigbee.ClusterID(0x0428)
	WaterConcentrationSodiumId                = zigbee.ClusterID(0x0429)
	AirConcentrationPM25Id                    = zigbee.ClusterID(0x042a)
	AirConcentrationFormaldehydeId            = zigbee.ClusterID(0x042b)
	IASZoneId                                 = zigbee.ClusterID(0x0500)
	IASAncillaryControlEquipmentId            = zigbee.ClusterID(0x0501)
	IASWarningDevicesId                       = zigbee.ClusterID(0x0502)
	GenericTunnelId                           = zigbee.ClusterID(0x0600)
	BACnetProtocolTunnelId                    = zigbee.ClusterID(0x0601)
	AnalogInputBACnetRegularId                = zigbee.ClusterID(0x0602)
	AnalogInputBACnetExtendedId               = zigbee.ClusterID(0x0603)
	AnalogOutputBACnetRegularId               = zigbee.ClusterID(0x0604)
	AnalogOutputBACnetExtendedId              = zigbee.ClusterID(0x0605)
	AnalogValueBACnetRegularId                = zigbee.ClusterID(0x0606)
	AnalogValueBACnetExtendedId               = zigbee.ClusterID(0x0607)
	BinaryInputBACnetRegularId                = zigbee.ClusterID(0x0608)
	BinaryInputBACnetExtendedId               = zigbee.ClusterID(0x0609)
	BinaryOutputBACnetRegularId               = zigbee.ClusterID(0x060a)
	BinaryOutputBACnetExtendedId              = zigbee.ClusterID(0x060b)
	BinaryValueBACnetRegularId                = zigbee.ClusterID(0x060c)
	BinaryValueBACnetExtendedId               = zigbee.ClusterID(0x060d)
	MultistateInputBACnetRegularId            = zigbee.ClusterID(0x060e)
	MultistateInputBACnetExtendedId           = zigbee.ClusterID(0x060f)
	MultistateOutputBACnetRegularId           = zigbee.ClusterID(0x0610)
	MultistateOutputBACnetExtendedId          = zigbee.ClusterID(0x0611)
	MultistateValueBACnetRegularId            = zigbee.ClusterID(0x0612)
	MultistateValueBACnetExtendedId           = zigbee.ClusterID(0x0613)
	ISO11073ProtocolTunnelId                  = zigbee.ClusterID(0x0614)
	ISO7816TunnelId                           = zigbee.ClusterID(0x0615)
	RetailTunnelClusterId                     = zigbee.ClusterID(0x0617)
	PriceId                                   = zigbee.ClusterID(0x0700)
	DemandResponseAndLoadControlId            = zigbee.ClusterID(0x0701)
	MeteringId                                = zigbee.ClusterID(0x0702)
	MessagingId                               = zigbee.ClusterID(0x0703)
	TunnelingId                               = zigbee.ClusterID(0x0704)
	PrepaymentId                              = zigbee.ClusterID(0x0705)
	CalendarId                                = zigbee.ClusterID(0x0707)
	DeviceManagementId                        = zigbee.ClusterID(0x0708)
	EventsId                                  = zigbee.ClusterID(0x0709)
	SubGHzId                                  = zigbee.ClusterID(0x070b)
	KeyEstablishmentId                        = zigbee.ClusterID(0x0800)
	InformationId                             = zigbee.ClusterID(0x0900)
	VoiceOverZigBeeId                         = zigbee.ClusterID(0x0904)
	ChattingId                                = zigbee.ClusterID(0x0905)
	EN50523ApplianceIdentificationId          = zigbee.ClusterID(0x0b00)
	MeterIdentificationId                     = zigbee.ClusterID(0x0b01)
	EN50523ApplianceEventsAndAlertsId         = zigbee.ClusterID(0x0b02)
	EN50523ApplianceStatisticsId              = zigbee.ClusterID(0x0b03)
	ElectricalMeasurementId                   = zigbee.ClusterID(0x0b04)
	DiagnosticsId                             = zigbee.ClusterID(0x0b05)
	TouchlinkId                               = zigbee.ClusterID(0x1000)
)

Variables

View Source
var ClusterList = map[zigbee.ClusterID]string{}/* 133 elements not displayed */

Functions

This section is empty.

Types

type AttributeDataType

type AttributeDataType byte
const (
	TypeNull AttributeDataType = 0x00

	TypeData8  AttributeDataType = 0x08
	TypeData16 AttributeDataType = 0x09
	TypeData24 AttributeDataType = 0x0a
	TypeData32 AttributeDataType = 0x0b
	TypeData40 AttributeDataType = 0x0c
	TypeData48 AttributeDataType = 0x0d
	TypeData56 AttributeDataType = 0x0e
	TypeData64 AttributeDataType = 0x0f

	TypeBoolean AttributeDataType = 0x10

	TypeBitmap8  AttributeDataType = 0x18
	TypeBitmap16 AttributeDataType = 0x19
	TypeBitmap24 AttributeDataType = 0x1a
	TypeBitmap32 AttributeDataType = 0x1b
	TypeBitmap40 AttributeDataType = 0x1c
	TypeBitmap48 AttributeDataType = 0x1d
	TypeBitmap56 AttributeDataType = 0x1e
	TypeBitmap64 AttributeDataType = 0x1f

	TypeUnsignedInt8  AttributeDataType = 0x20
	TypeUnsignedInt16 AttributeDataType = 0x21
	TypeUnsignedInt24 AttributeDataType = 0x22
	TypeUnsignedInt32 AttributeDataType = 0x23
	TypeUnsignedInt40 AttributeDataType = 0x24
	TypeUnsignedInt48 AttributeDataType = 0x25
	TypeUnsignedInt56 AttributeDataType = 0x26
	TypeUnsignedInt64 AttributeDataType = 0x27

	TypeSignedInt8  AttributeDataType = 0x28
	TypeSignedInt16 AttributeDataType = 0x29
	TypeSignedInt24 AttributeDataType = 0x2a
	TypeSignedInt32 AttributeDataType = 0x2b
	TypeSignedInt40 AttributeDataType = 0x2c
	TypeSignedInt48 AttributeDataType = 0x2d
	TypeSignedInt56 AttributeDataType = 0x2e
	TypeSignedInt64 AttributeDataType = 0x2f

	TypeEnum8  AttributeDataType = 0x30
	TypeEnum16 AttributeDataType = 0x31

	TypeFloatSemi   AttributeDataType = 0x38
	TypeFloatSingle AttributeDataType = 0x39
	TypeFloatDouble AttributeDataType = 0x3a

	TypeStringOctet8      AttributeDataType = 0x41
	TypeStringCharacter8  AttributeDataType = 0x42
	TypeStringOctet16     AttributeDataType = 0x43
	TypeStringCharacter16 AttributeDataType = 0x44

	TypeArray     AttributeDataType = 0x48
	TypeStructure AttributeDataType = 0x4c
	TypeSet       AttributeDataType = 0x50
	TypeBag       AttributeDataType = 0x51

	TypeTimeOfDay AttributeDataType = 0xe0
	TypeDate      AttributeDataType = 0xe1
	TypeUTCTime   AttributeDataType = 0xe2

	TypeClusterID   AttributeDataType = 0xe9
	TypeAttributeID AttributeDataType = 0xea
	TypeBACnetOID   AttributeDataType = 0xeb

	TypeIEEEAddress    AttributeDataType = 0xf0
	TypeSecurityKey128 AttributeDataType = 0xf1
	TypeUnknown        AttributeDataType = 0xff
)

type AttributeDataTypeValue

type AttributeDataTypeValue struct {
	DataType AttributeDataType
	Value    interface{}
}

func (*AttributeDataTypeValue) Marshal

func (*AttributeDataTypeValue) Unmarshal

type AttributeDataValue

type AttributeDataValue struct {
	Value interface{}
}

func (*AttributeDataValue) Marshal

func (*AttributeDataValue) Unmarshal

type AttributeID

type AttributeID uint16

type AttributeSlice

type AttributeSlice struct {
	DataType AttributeDataType
	Values   []interface{}
}

type BACnetOID

type BACnetOID uint32

type CommandIdentifier

type CommandIdentifier uint8

type CommandRegistry

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

func NewCommandRegistry

func NewCommandRegistry() *CommandRegistry

func (*CommandRegistry) GetGlobalCommand

func (cr *CommandRegistry) GetGlobalCommand(identifier CommandIdentifier) (interface{}, error)

func (*CommandRegistry) GetGlobalCommandIdentifier

func (cr *CommandRegistry) GetGlobalCommandIdentifier(command interface{}) (CommandIdentifier, error)

func (*CommandRegistry) GetLocalCommand

func (cr *CommandRegistry) GetLocalCommand(clusterID zigbee.ClusterID, manufacturer zigbee.ManufacturerCode, direction Direction, identifier CommandIdentifier) (interface{}, error)

func (*CommandRegistry) GetLocalCommandIdentifier

func (cr *CommandRegistry) GetLocalCommandIdentifier(clusterID zigbee.ClusterID, manufacturer zigbee.ManufacturerCode, direction Direction, command interface{}) (CommandIdentifier, error)

func (*CommandRegistry) Marshal

func (cr *CommandRegistry) Marshal(message Message) (zigbee.ApplicationMessage, error)

func (*CommandRegistry) RegisterGlobal

func (cr *CommandRegistry) RegisterGlobal(identifier CommandIdentifier, command interface{})

func (*CommandRegistry) RegisterLocal

func (cr *CommandRegistry) RegisterLocal(clusterID zigbee.ClusterID, manufacturer zigbee.ManufacturerCode, direction Direction, identifier CommandIdentifier, command interface{})

func (*CommandRegistry) Unmarshal

func (cr *CommandRegistry) Unmarshal(appMsg zigbee.ApplicationMessage) (Message, error)

type Control

type Control struct {
	Reserved               uint8     `bcfieldwidth:"3"`
	DisableDefaultResponse bool      `bcfieldwidth:"1"`
	Direction              Direction `bcfieldwidth:"1"`
	ManufacturerSpecific   bool      `bcfieldwidth:"1"`
	FrameType              FrameType `bcfieldwidth:"2"`
}

type Date

type Date struct {
	Year       uint8
	Month      uint8
	DayOfMonth uint8
	DayOfWeek  uint8
}

type Direction

type Direction uint8
const (
	ClientToServer Direction = 0
	ServerToClient Direction = 1
)

type FrameType

type FrameType uint8
const (
	FrameGlobal FrameType = 0x00
	FrameLocal  FrameType = 0x01
)
type Header struct {
	Control             Control
	Manufacturer        zigbee.ManufacturerCode `bcincludeif:".Control.ManufacturerSpecific"`
	TransactionSequence uint8
	CommandIdentifier   CommandIdentifier
}

type Message

type Message struct {
	FrameType           FrameType
	Direction           Direction
	TransactionSequence uint8
	Manufacturer        zigbee.ManufacturerCode
	ClusterID           zigbee.ClusterID
	SourceEndpoint      zigbee.Endpoint
	DestinationEndpoint zigbee.Endpoint
	CommandIdentifier   CommandIdentifier
	Command             interface{}
}

type TimeOfDay

type TimeOfDay struct {
	Hours      uint8
	Minutes    uint8
	Seconds    uint8
	Hundredths uint8
}

type UTCTime

type UTCTime uint32

Jump to

Keyboard shortcuts

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