zcl

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

ZCL

go.dev reference CI badge

This is a Zigbee™ Cluster Library. It's primarily aimed at Go users but also contains a TypeScript library.

Generated code

The packages under cluster/ and zdo/ are auto-generated from definitions in hemtjanst/zyaml using the templates in template/.

Regenerate code by running:

# Create go/typescript source code
go run hemtjan.st/zcl/cmd/zclgen -definition-path ../path-to-zyaml

# Test and build generated code
go test hemtjan.st/zcl/...
go build hemtjan.st/zcl/...

# Transpile typescript
tsc -d ./cluster/all.ts --outFile ../javascript-output/zigbee.js --sourceMap --module amd

Attribution

Zigbee is a trademark of the Zigbee Alliance.

Documentation

Index

Constants

View Source
const (
	ErrNotEnoughData           errType = "not enough data"
	ErrTooMuchData             errType = "too much data"
	ErrNotImpl                 errType = "not implemented"
	ErrInvalidArrayLength      errType = "invalid length for array"
	ErrInvalidType             errType = "invalid type"
	ErrTimeout                 errType = "timeout"
	ErrInvalidHandler          errType = "invalid handler"
	ErrInvalidPacket           errType = "invalid packet"
	ErrCommandClusterSpecific  errType = "command is cluster-specific, cannot use as profile-wide"
	ErrCommandProfileWide      errType = "command is profile-wide, cannot use as cluster-specific"
	ErrResponseClusterSpecific errType = "request is profile-wide, cannot respond with cluster-specific command"
	ErrResponseProfileWide     errType = "request is cluster-specific, cannot respond with profile-wide command"
	ErrResponseWrongCluster    errType = "response cluster does not match request"
	ErrResponseWrongMnfCode    errType = "response mnfCode does not match request"
	ErrUnknownCommand          errType = "unknown command"
)
View Source
const (
	ServerToClient          Direction   = true
	ClientToServer          Direction   = false
	ProfileWide             CommandType = 0
	ClusterSpecific         CommandType = 1
	GroupAddress            AddressMode = 0x01
	NWKAddress              AddressMode = 0x02
	IEEEAddress             AddressMode = 0x03
	FullAddress             AddressMode = 0x04
	BroadcastAll            uint16      = 0xFFFF
	BroadcastRxOnWhenIdle   uint16      = 0xFFFD
	BroadcastRoutersCoords  uint16      = 0xFFFC
	BroadcastLowPowerRouter uint16      = 0xFFFB
)
View Source
const UnixtimeOffset = 946684800

UnixtimeOffset specifies the offset between zigbee time (epoch = 2000-01-01 UTC) and unixtime in seconds

Variables

View Source
var (
	StrJoin   = strings.Join
	Sprintf   = fmt.Sprintf
	Errorf    = fmt.Errorf
	ToJson    = json.Marshal
	ParseJson = json.Unmarshal
)

Functions

func ArrayMarshalZcl

func ArrayMarshalZcl(ln string, t TypeID, v []Val) ([]byte, error)

func ArrayNoTypeMarshalZcl

func ArrayNoTypeMarshalZcl(ln string, v []Val) ([]byte, error)

func ArrayUnmarshalZcl

func ArrayUnmarshalZcl(ln string, b []byte) (TypeID, []Val, []byte, error)

func BitmapList

func BitmapList(b []byte) []int

func BitmapSet

func BitmapSet(a []byte, b uint, v bool) []byte

func BitmapStringer

func BitmapStringer(b []byte) string

func BitmapTest

func BitmapTest(a []byte, b uint) bool

func BytesStringer

func BytesStringer(b []byte) string

func Duration

func Duration(t int, m int) time.Duration

func Equal

func Equal(a, b Val) bool

func JsonAttr

func JsonAttr(a Attr) ([]byte, error)

func StructMarshalZcl

func StructMarshalZcl(ln string, v []StructField) ([]byte, error)

func UnmarshalList

func UnmarshalList(ln string, b []byte, newVal func() Val) ([]byte, error)

Types

type Address

type Address interface {
	Mode() AddressMode
	NWK() uint16
	IEEE() net.HardwareAddr
}

type AddressMode

type AddressMode uint8

func (AddressMode) String

func (a AddressMode) String() string

type ArgDesc

type ArgDesc struct {
	Argument Argument
	Name     string
}

type Argument

type Argument interface {
	TypeVal
	Name() string
	String() string
	Value() Val
	SetValue(v Val) error
}

type Attr

type Attr interface {
	Argument
	ID() AttrID
	Readable() bool
	Writable() bool
	Reportable() bool
	SceneIndex() int
}

type AttrDef

type AttrDef interface {
	AttrID() AttrID
	AttrType() TypeID
}

type AttrID

type AttrID Zu16

func (AttrID) MarshalZcl

func (i AttrID) MarshalZcl() ([]byte, error)

func (*AttrID) UnmarshalZcl

func (i *AttrID) UnmarshalZcl(b []byte) ([]byte, error)

type AttrValue

type AttrValue interface {
	AttrDef
	AttrValue() Val
}

type BitmapArg

type BitmapArg interface {
	MultiOptions() []Option
}

type Cluster

type Cluster struct {
	Name       string
	ServerCmd  map[CommandID]func() Command
	ServerAttr map[AttrID]func() Attr
	ClientCmd  map[CommandID]func() Command
	ClientAttr map[AttrID]func() Attr
	SceneAttr  []AttrID
}

func (*Cluster) Attr

func (c *Cluster) Attr(id uint16) Attr

func (*Cluster) Cmd

func (c *Cluster) Cmd(id uint8) Command

func (*Cluster) CmdFn

func (c *Cluster) CmdFn(id uint8) func() Command

type ClusterAttr

type ClusterAttr interface {
	Attr
	Cluster() ClusterID
}

type ClusterAttrImpl

type ClusterAttrImpl struct {
	Attr
	ClusterID ClusterID
}

func (ClusterAttrImpl) Cluster

func (c ClusterAttrImpl) Cluster() ClusterID

type ClusterID

type ClusterID Zu16

func (ClusterID) MarshalZcl

func (i ClusterID) MarshalZcl() ([]byte, error)

func (*ClusterID) UnmarshalZcl

func (i *ClusterID) UnmarshalZcl(b []byte) ([]byte, error)

type Command

type Command interface {
	General
	Arguments() []ArgDesc
	Cluster() ClusterID
	Required() bool
	MnfCode() uint16
}

type CommandDescription

type CommandDescription struct {
	Name      string
	ClusterID *ClusterID
	Required  bool
	MnfCode   *uint16
	List      bool
	Arguments []ValueDescription
}

func DescribeCommand

func DescribeCommand(cmd Command) (desc CommandDescription)

func DescribeGeneral

func DescribeGeneral(cmd General) (desc CommandDescription)

func DescribeZdoCommand

func DescribeZdoCommand(cmd ZdoCommand) (desc CommandDescription)

type CommandID

type CommandID Zu8
const DefaultResponseCommand CommandID = 0x0b

func (CommandID) MarshalZcl

func (i CommandID) MarshalZcl() ([]byte, error)

func (*CommandID) UnmarshalZcl

func (i *CommandID) UnmarshalZcl(b []byte) ([]byte, error)

type CommandType

type CommandType uint8

func (CommandType) String

func (t CommandType) String() string

type CustomUnit

type CustomUnit uint8
const (
	DecibelMilliWatts CustomUnit = iota
	MilliAmpereHours
	Mired
	Bytes
)

func (CustomUnit) Format

func (u CustomUnit) Format(n float64) string

func (CustomUnit) String

func (u CustomUnit) String() string

type DefaultResponse

type DefaultResponse struct {
	Command CommandID
	Status  Status
}

func (DefaultResponse) Direction

func (DefaultResponse) Direction() Direction

func (*DefaultResponse) Handle

func (v *DefaultResponse) Handle(frame ReceivedZclFrame, handler interface{}) (rsp General, found bool, err error)

func (DefaultResponse) ID

func (DefaultResponse) MarshalZcl

func (v DefaultResponse) MarshalZcl() ([]byte, error)

func (DefaultResponse) Name

func (DefaultResponse) Name() string

func (DefaultResponse) String

func (v DefaultResponse) String() string

func (*DefaultResponse) UnmarshalZcl

func (v *DefaultResponse) UnmarshalZcl(b []byte) ([]byte, error)

func (*DefaultResponse) Values

func (v *DefaultResponse) Values() []Val

type DefaultResponseHandler

type DefaultResponseHandler interface {
	HandleDefaultResponse(ZclFrame, *DefaultResponse) error
}

type Direction

type Direction bool

func (Direction) String

func (d Direction) String() string

type EngineeringUnit

type EngineeringUnit uint16

func (EngineeringUnit) Format

func (u EngineeringUnit) Format(v float64) string

func (EngineeringUnit) MarshalZcl

func (u EngineeringUnit) MarshalZcl() ([]byte, error)

func (EngineeringUnit) String

func (u EngineeringUnit) String() string

func (EngineeringUnit) TypeID

func (EngineeringUnit) TypeID() TypeID

func (EngineeringUnit) Unit

func (u EngineeringUnit) Unit() Unit

func (*EngineeringUnit) UnmarshalZcl

func (u *EngineeringUnit) UnmarshalZcl(buf []byte) ([]byte, error)

func (*EngineeringUnit) Values

func (u *EngineeringUnit) Values() []Val

type EnumArg

type EnumArg interface {
	SingleOptions() []Option
}

type General

type General interface {
	Val
	Values() []Val
	ID() CommandID
	Name() string
	String() string
	Direction() Direction
	Handle(frame ReceivedZclFrame, handler interface{}) (response General, found bool, err error)
}

type Handler

type Handler interface {
	ZclHandler
	ZdpHandler
}

type InArg

type InArg interface {
	MarshalZcl() ([]byte, error)
}

type Option

type Option struct {
	Name  string
	Value int
}

type OutArg

type OutArg interface {
	UnmarshalZcl([]byte) ([]byte, error)
}

type Packet

type Packet interface {
	SrcEP() uint8
	DstEP() uint8
	DstAddr() Address
	Profile() ProfileID
	Cluster() ClusterID
	Data() []byte
}

func Handle

func Handle(handler Handler, packet Packet) (Packet, error)

func NewPacket

func NewPacket(srcEp uint8, dstAddr Address, dstEp uint8, profile ProfileID, cluster ClusterID, data ...InArg) (p Packet, err error)

type ProfileID

type ProfileID Zu16

func (ProfileID) MarshalZcl

func (i ProfileID) MarshalZcl() ([]byte, error)

func (*ProfileID) UnmarshalZcl

func (i *ProfileID) UnmarshalZcl(b []byte) ([]byte, error)

type ReceivedPacket

type ReceivedPacket interface {
	Packet
	// contains filtered or unexported methods
}

type ReceivedZclFrame

type ReceivedZclFrame interface {
	ZclFrame

	Response(srcEp uint8, cmd General) (ZclFrame, error)
	// contains filtered or unexported methods
}

type ReceivedZdpFrame

type ReceivedZdpFrame interface {
	ZdpFrame

	Response(cmd ZdoCommand) (ZdpFrame, error)
	// contains filtered or unexported methods
}

type ScaledArg

type ScaledArg interface {
	Scaled() float64
}

type SceneExtension

type SceneExtension interface {
	ClusterID() uint16
	Val
}

type SceneExtensionSet

type SceneExtensionSet []SceneExtension

func (SceneExtensionSet) MarshalZcl

func (s SceneExtensionSet) MarshalZcl() ([]byte, error)

func (SceneExtensionSet) String

func (s SceneExtensionSet) String() string

func (SceneExtensionSet) TypeID

func (SceneExtensionSet) TypeID() TypeID

func (*SceneExtensionSet) UnmarshalZcl

func (s *SceneExtensionSet) UnmarshalZcl(b []byte) ([]byte, error)

type Status

type Status Zenum8
const (
	Success                  Status = 0x00
	Failure                  Status = 0x01
	NotAuthorized            Status = 0x7e
	ReservedFieldNotZero     Status = 0x7f
	MalformedCommand         Status = 0x80
	UnsupClusterCommand      Status = 0x81
	UnsupGeneralCommand      Status = 0x82
	UnsupManufClusterCommand Status = 0x83
	UnsupManufGeneralCommand Status = 0x84
	InvalidField             Status = 0x85
	UnsupportedAttribute     Status = 0x86
	InvalidValue             Status = 0x87
	ReadOnly                 Status = 0x88
	InsufficientSpace        Status = 0x89
	DuplicateExists          Status = 0x8a
	NotFound                 Status = 0x8b
	UnreportableAttribute    Status = 0x8c
	InvalidDataType          Status = 0x8d
	InvalidSector            Status = 0x8e
	WriteOnly                Status = 0x8f
	InconsistentStartupState Status = 0x90
	DefinedOutOfBand         Status = 0x91
	HardwareFailure          Status = 0xc0
	SoftwareFailure          Status = 0xc1
	CalibrationError         Status = 0xc2
)

func (Status) Error

func (e Status) Error() string

func (Status) MarshalZcl

func (e Status) MarshalZcl() ([]byte, error)

func (Status) Status

func (e Status) Status() Status

func (Status) String

func (e Status) String() string

func (Status) TypeID

func (e Status) TypeID() TypeID

func (*Status) UnmarshalZcl

func (e *Status) UnmarshalZcl(buf []byte) ([]byte, error)

func (Status) Valid

func (e Status) Valid() bool

func (*Status) Values

func (e *Status) Values() []Val

type StatusError

type StatusError interface {
	Status() Status
}

type StructField

type StructField struct {
	Type    TypeID
	Content Val
}

func StructUnmarshalZcl

func StructUnmarshalZcl(ln string, b []byte) ([]StructField, []byte, error)

func (StructField) String

func (s StructField) String() string

type Transport

type Transport interface {
	Send(Packet) error
	SetPermitJoin(time uint8) error
	NWKAddr() (uint16, error)
	IEEEAddr() (Zuid, error)
}

type TypeID

type TypeID Zu8

func (TypeID) Analog

func (i TypeID) Analog() bool

func (TypeID) MarshalZcl

func (i TypeID) MarshalZcl() ([]byte, error)

func (TypeID) New

func (i TypeID) New() Val

func (TypeID) Size

func (i TypeID) Size() int

func (TypeID) String

func (i TypeID) String() string

func (*TypeID) UnmarshalZcl

func (i *TypeID) UnmarshalZcl(b []byte) ([]byte, error)

type TypeVal

type TypeVal interface {
	Val
	TypeID() TypeID
}

type Unit

type Unit uint8
const (
	SquareMeters                    Unit = 0x00 //  Area
	SquareFeet                      Unit = 0x01 //  Area
	Milliamperes                    Unit = 0x02 //  Electrical
	Amperes                         Unit = 0x03 //  Electrical
	Ohms                            Unit = 0x04 //  Electrical
	Volts                           Unit = 0x05 //  Electrical
	KiloVolts                       Unit = 0x06 //  Electrical
	MegaVolts                       Unit = 0x07 //  Electrical
	VoltAmperes                     Unit = 0x08 //  Electrical
	KiloVoltAmperes                 Unit = 0x09 //  Electrical
	MegaVoltAmperes                 Unit = 0x0A //  Electrical
	VoltAmperesReactive             Unit = 0x0B //  Electrical
	KiloVoltAmperesReactive         Unit = 0x0C //  Electrical
	MegaVoltAmperesReactive         Unit = 0x0D //  Electrical
	DegreesPhase                    Unit = 0x0E //  Electrical
	PowerFactor                     Unit = 0x0F //  Electrical
	Joules                          Unit = 0x10 //  Energy
	Kilojoules                      Unit = 0x11 //  Energy
	WattHours                       Unit = 0x12 //  Energy
	KilowattHours                   Unit = 0x13 //  Energy
	BTUs                            Unit = 0x14 //  Energy
	Therms                          Unit = 0x15 //  Energy
	TonHours                        Unit = 0x16 //  Energy
	JoulesPerKilogramDryAir         Unit = 0x17 //  Enthalpy
	BTUsPerPoundDryAir              Unit = 0x18 //  Enthalpy
	CyclesPerHour                   Unit = 0x19 //  Frequency
	CyclesPerMinute                 Unit = 0x1A //  Frequency
	Hertz                           Unit = 0x1B //  Frequency
	GramsOfWaterPerKilogramDryAir   Unit = 0x1C //  Humidity
	PercentRelativeHumidity         Unit = 0x1D //  Humidity
	Millimeters                     Unit = 0x1E //  Length
	Meters                          Unit = 0x1F //  Length
	Inches                          Unit = 0x20 //  Length
	Feet                            Unit = 0x21 //  Length
	WattsPerSquareFoot              Unit = 0x22 //  Light
	WattsPerSquareMeter             Unit = 0x23 //  Light
	Lumens                          Unit = 0x24 //  Light
	Luxes                           Unit = 0x25 //  Light
	FootCandles                     Unit = 0x26 //  Light
	Kilograms                       Unit = 0x27 //  Mass
	PoundsMass                      Unit = 0x28 //  Mass
	Tons                            Unit = 0x29 //  Mass
	KilogramsPerSecond              Unit = 0x2A //  Mass Flow
	KilogramsPerMinute              Unit = 0x2B //  Mass Flow
	KilogramsPerHour                Unit = 0x2C //  Mass Flow
	PoundsMassPerMinute             Unit = 0x2D //  Mass Flow
	PoundsMassPerHour               Unit = 0x2E //  Mass Flow
	Watts                           Unit = 0x2F //  Power
	Kilowatts                       Unit = 0x30 //  Power
	Megawatts                       Unit = 0x31 //  Power
	BTUsPerHour                     Unit = 0x32 //  Power
	Horsepower                      Unit = 0x33 //  Power
	TonsRefrigeration               Unit = 0x34 //  Power
	Pascals                         Unit = 0x35 //  Pressure
	Kilopascals                     Unit = 0x36 //  Pressure
	Bars                            Unit = 0x37 //  Pressure
	PoundsForcePerSquareInch        Unit = 0x38 //  Pressure
	CentimetersOfWater              Unit = 0x39 //  Pressure
	InchesOfWater                   Unit = 0x3A //  Pressure
	MillimetersOfMercury            Unit = 0x3B //  Pressure
	CentimetersOfMercury            Unit = 0x3C //  Pressure
	InchesOfMercury                 Unit = 0x3D //  Pressure
	DegreesCelsius                  Unit = 0x3E //  Temperature
	DegreesKelvin                   Unit = 0x3F //  Temperature
	DegreesFahrenheit               Unit = 0x40 //  Temperature
	DegreeDaysCelsius               Unit = 0x41 //  Temperature
	DegreeDaysFahrenheit            Unit = 0x42 //  Temperature
	Years                           Unit = 0x43 //  Time
	Months                          Unit = 0x44 //  Time
	Weeks                           Unit = 0x45 //  Time
	Days                            Unit = 0x46 //  Time
	Hours                           Unit = 0x47 //  Time
	Minutes                         Unit = 0x48 //  Time
	Seconds                         Unit = 0x49 //  Time
	MetersPerSecond                 Unit = 0x4A //  Velocity
	KilometersPerHour               Unit = 0x4B //  Velocity
	FeetPerSecond                   Unit = 0x4C //  Velocity
	FeetPerMinute                   Unit = 0x4D //  Velocity
	MilesPerHour                    Unit = 0x4E //  Velocity
	CubicFeet                       Unit = 0x4F //  Volume
	CubicMeters                     Unit = 0x50 //  Volume
	ImperialGallons                 Unit = 0x51 //  Volume
	Liters                          Unit = 0x52 //  Volume
	UsGallons                       Unit = 0x53 //  Volume
	CubicFeetPerMinute              Unit = 0x54 //  Volumetric Flow
	CubicMetersPerSecond            Unit = 0x55 //  Volumetric Flow
	ImperialGallonsPerMinute        Unit = 0x56 //  Volumetric Flow
	LitersPerSecond                 Unit = 0x57 //  Volumetric Flow
	LitersPerMinute                 Unit = 0x58 //  Volumetric Flow
	UsGallonsPerMinute              Unit = 0x59 //  Volumetric Flow
	DegreesAngular                  Unit = 0x5A //  Other
	DegreesCelsiusPerHour           Unit = 0x5B //  Other
	DegreesCelsiusPerMinute         Unit = 0x5C //  Other
	DegreesFahrenheitPerHour        Unit = 0x5D //  Other
	DegreesFahrenheitPerMinute      Unit = 0x5E //  Other
	NoUnits                         Unit = 0x5F //  Other
	PartsPerMillion                 Unit = 0x60 //  Other
	PartsPerBillion                 Unit = 0x61 //  Other
	Percent                         Unit = 0x62 //  Other
	PercentPerSecond                Unit = 0x63 //  Other
	PerMinute                       Unit = 0x64 //  Other
	PerSecond                       Unit = 0x65 //  Other
	PsiPerDegreeFahrenheit          Unit = 0x66 //  Other
	Radians                         Unit = 0x67 //  Other
	RevolutionsPerMinute            Unit = 0x68 //  Other
	Currency1                       Unit = 0x69 //  Currency
	Currency2                       Unit = 0x6A //  Currency
	Currency3                       Unit = 0x6B //  Currency
	Currency4                       Unit = 0x6C //  Currency
	Currency5                       Unit = 0x6D //  Currency
	Currency6                       Unit = 0x6E //  Currency
	Currency7                       Unit = 0x6F //  Currency
	Currency8                       Unit = 0x70 //  Currency
	Currency9                       Unit = 0x71 //  Currency
	Currency10                      Unit = 0x72 //  Currency
	SquareInches                    Unit = 0x73 //  Area
	SquareCentimeters               Unit = 0x74 //  Area
	BTUsPerPound                    Unit = 0x75 //  Enthalpy
	Centimeters                     Unit = 0x76 //  Length
	PoundsMassPerSecond             Unit = 0x77 //  Mass Flow
	DeltaDegreesFahrenheit          Unit = 0x78 //  Temperature
	DeltaDegreesKelvin              Unit = 0x79 //  Temperature
	Kilohms                         Unit = 0x7A //  Electrical
	Megohms                         Unit = 0x7B //  Electrical
	Millivolts                      Unit = 0x7C //  Electrical
	KilojoulesPerKilogram           Unit = 0x7D //  Energy
	Megajoules                      Unit = 0x7E //  Energy
	JoulesPerDegreeKelvin           Unit = 0x7F //  Entrophy
	JoulesPerKilogramDegreeKelvin   Unit = 0x80 //  Entrophy
	Kilohertz                       Unit = 0x81 //  Frequency
	Megahertz                       Unit = 0x82 //  Frequency
	PerHour                         Unit = 0x83 //  Frequency
	Milliwatts                      Unit = 0x84 //  Power
	Hectopascals                    Unit = 0x85 //  Pressure
	Millibars                       Unit = 0x86 //  Pressure
	CubicMetersPerHour              Unit = 0x87 //  Volumetric Flow
	LitersPerHour                   Unit = 0x88 //  Volumetric Flow
	KilowattHoursPerSquareMeter     Unit = 0x89 //  Other
	KilowattHoursPerSquareFoot      Unit = 0x8A //  Other
	MegajoulesPerSquareMeter        Unit = 0x8B //  Other
	MegajoulesPerSquareFoot         Unit = 0x8C //  Other
	WattsPerSquareMeterDegreeKelvin Unit = 0x8D //  Other
	CubicFeetPerSecond              Unit = 0x8E //  Volumetric Flow
	PercentObscurationPerFoot       Unit = 0x8F //  Other
	PercentObscurationPerMeter      Unit = 0x90 //  Other
	Milliohms                       Unit = 0x91 //  Electrical
	MegawattHours                   Unit = 0x92 //  Energy
	KiloBTUs                        Unit = 0x93 //  Energy
	MegaBTUs                        Unit = 0x94 //  Energy
	KilojoulesPerKilogramDryAir     Unit = 0x95 //  Enthalpy
	MegajoulesPerKilogramDryAir     Unit = 0x96 //  Enthalpy
	KilojoulesPerDegreeKelvin       Unit = 0x97 //  Entrophy
	MegajoulesPerDegreeKelvin       Unit = 0x98 //  Entrophy
	Newton                          Unit = 0x99 //  Force
	GramsPerSecond                  Unit = 0x9A //  Mass Flow
	GramsPerMinute                  Unit = 0x9B //  Mass Flow
	TonsPerHour                     Unit = 0x9C //  Mass Flow
	KiloBTUsPerHour                 Unit = 0x9D //  Power
	HundredthsSeconds               Unit = 0x9E //  Time
	Milliseconds                    Unit = 0x9F //  Time
	NewtonMeters                    Unit = 0xA0 //  Torque
	MillimetersPerSecond            Unit = 0xA1 //  Velocity
	MillimetersPerMinute            Unit = 0xA2 //  Velocity
	MetersPerMinute                 Unit = 0xA3 //  Velocity
	MetersPerHour                   Unit = 0xA4 //  Velocity
	CubicMetersPerMinute            Unit = 0xA5 //  Volumetric Flow
	MetersPerSecondPerSecond        Unit = 0xA6 //  Acceleration
	AmperesPerMeter                 Unit = 0xA7 //  Electrical
	AmperesPerSquareMeter           Unit = 0xA8 //  Electrical
	AmpereSquareMeters              Unit = 0xA9 //  Electrical
	Farads                          Unit = 0xAA //  Electrical
	Henrys                          Unit = 0xAB //  Electrical
	OhmMeters                       Unit = 0xAC //  Electrical
	Siemens                         Unit = 0xAD //  Electrical
	SiemensPerMeter                 Unit = 0xAE //  Electrical
	Teslas                          Unit = 0xAF //  Electrical
	VoltsPerDegreeKelvin            Unit = 0xB0 //  Electrical
	VoltsPerMeter                   Unit = 0xB1 //  Electrical
	Webers                          Unit = 0xB2 //  Electrical
	Candelas                        Unit = 0xB3 //  Light
	CandelasPerSquareMeter          Unit = 0xB4 //  Light
	KelvinsPerHour                  Unit = 0xB5 //  Temperature
	KelvinsPerMinute                Unit = 0xB6 //  Temperature
	JouleSeconds                    Unit = 0xB7 //  Other
	SquareMetersPerNewton           Unit = 0xB8 //  Other
	KilogramPerCubicMeter           Unit = 0xB9 //  Other
	NewtonSeconds                   Unit = 0xBA //  Other
	NewtonsPerMeter                 Unit = 0xBB //  Other
	WattsPerMeterPerDegreeKelvin    Unit = 0xBC //  Other
	Other                           Unit = 0xFF
)

func (Unit) Format

func (u Unit) Format(n float64) string

func (Unit) String

func (u Unit) String() string

type UnknownAttr

type UnknownAttr struct {
	Type      TypeID
	AttrID    AttrID
	ClusterID ClusterID
	AttrValue Val
}

func (UnknownAttr) Cluster

func (a UnknownAttr) Cluster() ClusterID

func (UnknownAttr) ID

func (a UnknownAttr) ID() AttrID

func (UnknownAttr) MarshalJSON

func (a UnknownAttr) MarshalJSON() ([]byte, error)

func (UnknownAttr) MarshalZcl

func (a UnknownAttr) MarshalZcl() ([]byte, error)

func (UnknownAttr) Name

func (a UnknownAttr) Name() string

func (UnknownAttr) Readable

func (a UnknownAttr) Readable() bool

func (UnknownAttr) Reportable

func (a UnknownAttr) Reportable() bool

func (UnknownAttr) SceneIndex

func (a UnknownAttr) SceneIndex() int

func (UnknownAttr) SetValue

func (a UnknownAttr) SetValue(v Val) error

func (UnknownAttr) String

func (a UnknownAttr) String() string

func (UnknownAttr) TypeID

func (a UnknownAttr) TypeID() TypeID

func (*UnknownAttr) UnmarshalJSON

func (a *UnknownAttr) UnmarshalJSON(b []byte) error

func (*UnknownAttr) UnmarshalZcl

func (a *UnknownAttr) UnmarshalZcl(b []byte) ([]byte, error)

func (*UnknownAttr) Value

func (a *UnknownAttr) Value() Val

func (UnknownAttr) Writable

func (a UnknownAttr) Writable() bool

type Val

type Val interface {
	InArg
	OutArg
}

func ArrayNoTypeUnmarshalZcl

func ArrayNoTypeUnmarshalZcl(ln string, b []byte, t TypeID) ([]Val, []byte, error)

func FromString

func FromString(dataType uint8, val ...string) Val

func NewValue

func NewValue(dataType uint8) Val

type ValueDescription

type ValueDescription struct {
	Index        int
	Name         string
	Type         TypeID
	List         bool
	ListType     *ValueDescription
	EnumValues   []Option
	BitmapValues []Option
	Default      Val
}

func DescribeArgs

func DescribeArgs(cmd interface{}) (v []ValueDescription)

func DescribeAttr

func DescribeAttr(attr Argument) (desc ValueDescription)

type Zaid

type Zaid uint16

Zaid is Attribute ID (0xffff = invalid). A/D = D

func (Zaid) MarshalZcl

func (a Zaid) MarshalZcl() ([]byte, error)

func (Zaid) String

func (a Zaid) String() string

func (Zaid) TypeID

func (a Zaid) TypeID() TypeID

func (*Zaid) UnmarshalZcl

func (a *Zaid) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zaid) Valid

func (a Zaid) Valid() bool

func (*Zaid) Values

func (a *Zaid) Values() []Val

type Zarray

type Zarray struct {
	Type    TypeID
	Content []Val
}

Zarray is Array (0xffff = invalid). A/D = D

func (Zarray) MarshalZcl

func (a Zarray) MarshalZcl() ([]byte, error)

func (Zarray) String

func (a Zarray) String() string

func (Zarray) TypeID

func (a Zarray) TypeID() TypeID

func (*Zarray) UnmarshalZcl

func (a *Zarray) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zarray) Values

func (a *Zarray) Values() []Val

type Zbag

type Zbag struct {
	Type    TypeID
	Content []Val
}

Zbag is Bag (0xffff = invalid). A/D = D

func (Zbag) MarshalZcl

func (b Zbag) MarshalZcl() ([]byte, error)

func (Zbag) String

func (b Zbag) String() string

func (Zbag) TypeID

func (b Zbag) TypeID() TypeID

func (*Zbag) UnmarshalZcl

func (b *Zbag) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zbag) Values

func (b *Zbag) Values() []Val

type Zbmp16

type Zbmp16 [2]byte

func (Zbmp16) MarshalJSON

func (b Zbmp16) MarshalJSON() ([]byte, error)

func (Zbmp16) MarshalZcl

func (b Zbmp16) MarshalZcl() ([]byte, error)

func (Zbmp16) String

func (b Zbmp16) String() string

func (Zbmp16) TypeID

func (b Zbmp16) TypeID() TypeID

func (*Zbmp16) UnmarshalJSON

func (b *Zbmp16) UnmarshalJSON(buf []byte) error

func (*Zbmp16) UnmarshalZcl

func (b *Zbmp16) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zbmp16) Values

func (b *Zbmp16) Values() []Val

type Zbmp24

type Zbmp24 [3]byte

func (Zbmp24) MarshalJSON

func (b Zbmp24) MarshalJSON() ([]byte, error)

func (Zbmp24) MarshalZcl

func (b Zbmp24) MarshalZcl() ([]byte, error)

func (Zbmp24) String

func (b Zbmp24) String() string

func (Zbmp24) TypeID

func (b Zbmp24) TypeID() TypeID

func (*Zbmp24) UnmarshalJSON

func (b *Zbmp24) UnmarshalJSON(buf []byte) error

func (*Zbmp24) UnmarshalZcl

func (b *Zbmp24) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zbmp24) Values

func (b *Zbmp24) Values() []Val

type Zbmp32

type Zbmp32 [4]byte

func (Zbmp32) MarshalJSON

func (b Zbmp32) MarshalJSON() ([]byte, error)

func (Zbmp32) MarshalZcl

func (b Zbmp32) MarshalZcl() ([]byte, error)

func (Zbmp32) String

func (b Zbmp32) String() string

func (Zbmp32) TypeID

func (b Zbmp32) TypeID() TypeID

func (*Zbmp32) UnmarshalJSON

func (b *Zbmp32) UnmarshalJSON(buf []byte) error

func (*Zbmp32) UnmarshalZcl

func (b *Zbmp32) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zbmp32) Values

func (b *Zbmp32) Values() []Val

type Zbmp40

type Zbmp40 [5]byte

func (Zbmp40) MarshalJSON

func (b Zbmp40) MarshalJSON() ([]byte, error)

func (Zbmp40) MarshalZcl

func (b Zbmp40) MarshalZcl() ([]byte, error)

func (Zbmp40) String

func (b Zbmp40) String() string

func (Zbmp40) TypeID

func (b Zbmp40) TypeID() TypeID

func (*Zbmp40) UnmarshalJSON

func (b *Zbmp40) UnmarshalJSON(buf []byte) error

func (*Zbmp40) UnmarshalZcl

func (b *Zbmp40) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zbmp40) Values

func (b *Zbmp40) Values() []Val

type Zbmp48

type Zbmp48 [6]byte

func (Zbmp48) MarshalJSON

func (b Zbmp48) MarshalJSON() ([]byte, error)

func (Zbmp48) MarshalZcl

func (b Zbmp48) MarshalZcl() ([]byte, error)

func (Zbmp48) String

func (b Zbmp48) String() string

func (Zbmp48) TypeID

func (b Zbmp48) TypeID() TypeID

func (*Zbmp48) UnmarshalJSON

func (b *Zbmp48) UnmarshalJSON(buf []byte) error

func (*Zbmp48) UnmarshalZcl

func (b *Zbmp48) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zbmp48) Values

func (b *Zbmp48) Values() []Val

type Zbmp56

type Zbmp56 [7]byte

func (Zbmp56) MarshalJSON

func (b Zbmp56) MarshalJSON() ([]byte, error)

func (Zbmp56) MarshalZcl

func (b Zbmp56) MarshalZcl() ([]byte, error)

func (Zbmp56) String

func (b Zbmp56) String() string

func (Zbmp56) TypeID

func (b Zbmp56) TypeID() TypeID

func (*Zbmp56) UnmarshalJSON

func (b *Zbmp56) UnmarshalJSON(buf []byte) error

func (*Zbmp56) UnmarshalZcl

func (b *Zbmp56) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zbmp56) Values

func (b *Zbmp56) Values() []Val

type Zbmp64

type Zbmp64 [8]byte

func (Zbmp64) MarshalJSON

func (b Zbmp64) MarshalJSON() ([]byte, error)

func (Zbmp64) MarshalZcl

func (b Zbmp64) MarshalZcl() ([]byte, error)

func (Zbmp64) String

func (b Zbmp64) String() string

func (Zbmp64) TypeID

func (b Zbmp64) TypeID() TypeID

func (*Zbmp64) UnmarshalJSON

func (b *Zbmp64) UnmarshalJSON(buf []byte) error

func (*Zbmp64) UnmarshalZcl

func (b *Zbmp64) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zbmp64) Values

func (b *Zbmp64) Values() []Val

type Zbmp8

type Zbmp8 [1]byte

func (Zbmp8) MarshalJSON

func (b Zbmp8) MarshalJSON() ([]byte, error)

func (Zbmp8) MarshalZcl

func (b Zbmp8) MarshalZcl() ([]byte, error)

func (Zbmp8) String

func (b Zbmp8) String() string

func (Zbmp8) TypeID

func (b Zbmp8) TypeID() TypeID

func (*Zbmp8) UnmarshalJSON

func (b *Zbmp8) UnmarshalJSON(buf []byte) error

func (*Zbmp8) UnmarshalZcl

func (b *Zbmp8) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zbmp8) Values

func (b *Zbmp8) Values() []Val

type Zbool

type Zbool uint8

func (Zbool) MarshalJSON

func (t Zbool) MarshalJSON() ([]byte, error)

func (Zbool) MarshalZcl

func (t Zbool) MarshalZcl() ([]byte, error)

func (Zbool) String

func (t Zbool) String() string

func (Zbool) TypeID

func (t Zbool) TypeID() TypeID

func (*Zbool) UnmarshalJSON

func (t *Zbool) UnmarshalJSON(b []byte) error

func (*Zbool) UnmarshalZcl

func (t *Zbool) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zbool) Valid

func (t Zbool) Valid() bool

func (*Zbool) Values

func (t *Zbool) Values() []Val

type Zbytes

type Zbytes []byte

func (Zbytes) MarshalZcl

func (d Zbytes) MarshalZcl() ([]byte, error)

func (Zbytes) String

func (d Zbytes) String() string

func (*Zbytes) UnmarshalZcl

func (d *Zbytes) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zbytes) Values

func (d *Zbytes) Values() []Val

type Zcid

type Zcid uint16

Zcid is Cluster ID (0xffff = invalid). A/D = D

func (Zcid) MarshalZcl

func (c Zcid) MarshalZcl() ([]byte, error)

func (Zcid) String

func (c Zcid) String() string

func (Zcid) TypeID

func (c Zcid) TypeID() TypeID

func (*Zcid) UnmarshalZcl

func (c *Zcid) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zcid) Valid

func (c Zcid) Valid() bool

func (*Zcid) Values

func (c *Zcid) Values() []Val

type ZclFrame

type ZclFrame interface {
	Packet
	// contains filtered or unexported methods
}

func NewClusterFrame

func NewClusterFrame(seq uint8, srcEp uint8, dstAddr Address, dstEp uint8, profile ProfileID, cmd Command) (frame ZclFrame, err error)

func NewProfileFrame

func NewProfileFrame(seq uint8, srcEp uint8, dstAddr Address, dstEp uint8, profile ProfileID, cluster ClusterID, cmd General) (frame ZclFrame, err error)

type ZclHandler

type ZclHandler interface {
	HandleZcl(ReceivedZclFrame) (response ZclFrame, err error)
}

type Zcstring

type Zcstring string

Zcstring is Character string (0xff = invalid). A/D = D

func (Zcstring) MarshalZcl

func (c Zcstring) MarshalZcl() ([]byte, error)

func (*Zcstring) String

func (c *Zcstring) String() string

func (Zcstring) TypeID

func (c Zcstring) TypeID() TypeID

func (*Zcstring) UnmarshalZcl

func (c *Zcstring) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zcstring) Values

func (c *Zcstring) Values() []Val

type Zdat16

type Zdat16 [2]byte

func (Zdat16) MarshalZcl

func (d Zdat16) MarshalZcl() ([]byte, error)

func (Zdat16) String

func (d Zdat16) String() string

func (Zdat16) TypeID

func (d Zdat16) TypeID() TypeID

func (*Zdat16) UnmarshalZcl

func (d *Zdat16) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zdat16) Values

func (d *Zdat16) Values() []Val

type Zdat24

type Zdat24 [3]byte

func (Zdat24) MarshalZcl

func (d Zdat24) MarshalZcl() ([]byte, error)

func (Zdat24) String

func (d Zdat24) String() string

func (Zdat24) TypeID

func (d Zdat24) TypeID() TypeID

func (*Zdat24) UnmarshalZcl

func (d *Zdat24) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zdat24) Values

func (d *Zdat24) Values() []Val

type Zdat32

type Zdat32 [4]byte

func (Zdat32) MarshalZcl

func (d Zdat32) MarshalZcl() ([]byte, error)

func (Zdat32) String

func (d Zdat32) String() string

func (Zdat32) TypeID

func (d Zdat32) TypeID() TypeID

func (*Zdat32) UnmarshalZcl

func (d *Zdat32) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zdat32) Values

func (d *Zdat32) Values() []Val

type Zdat40

type Zdat40 [5]byte

func (Zdat40) MarshalZcl

func (d Zdat40) MarshalZcl() ([]byte, error)

func (Zdat40) String

func (d Zdat40) String() string

func (Zdat40) TypeID

func (d Zdat40) TypeID() TypeID

func (*Zdat40) UnmarshalZcl

func (d *Zdat40) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zdat40) Values

func (d *Zdat40) Values() []Val

type Zdat48

type Zdat48 [6]byte

func (Zdat48) MarshalZcl

func (d Zdat48) MarshalZcl() ([]byte, error)

func (Zdat48) String

func (d Zdat48) String() string

func (Zdat48) TypeID

func (d Zdat48) TypeID() TypeID

func (*Zdat48) UnmarshalZcl

func (d *Zdat48) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zdat48) Values

func (d *Zdat48) Values() []Val

type Zdat56

type Zdat56 [7]byte

func (Zdat56) MarshalZcl

func (d Zdat56) MarshalZcl() ([]byte, error)

func (Zdat56) String

func (d Zdat56) String() string

func (Zdat56) TypeID

func (d Zdat56) TypeID() TypeID

func (*Zdat56) UnmarshalZcl

func (d *Zdat56) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zdat56) Values

func (d *Zdat56) Values() []Val

type Zdat64

type Zdat64 [8]byte

func (Zdat64) MarshalZcl

func (d Zdat64) MarshalZcl() ([]byte, error)

func (Zdat64) String

func (d Zdat64) String() string

func (Zdat64) TypeID

func (d Zdat64) TypeID() TypeID

func (*Zdat64) UnmarshalZcl

func (d *Zdat64) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zdat64) Values

func (d *Zdat64) Values() []Val

type Zdat8

type Zdat8 [1]byte

func (Zdat8) MarshalZcl

func (d Zdat8) MarshalZcl() ([]byte, error)

func (Zdat8) String

func (d Zdat8) String() string

func (Zdat8) TypeID

func (d Zdat8) TypeID() TypeID

func (*Zdat8) UnmarshalZcl

func (d *Zdat8) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zdat8) Values

func (d *Zdat8) Values() []Val

type Zdate

type Zdate struct {
	Year    int
	Month   time.Month
	Day     int
	Weekday time.Weekday
}

Zdate is Date (0xffffffff = invalid). A/D = A

func (Zdate) MarshalZcl

func (d Zdate) MarshalZcl() ([]byte, error)

func (Zdate) String

func (d Zdate) String() string

func (Zdate) TypeID

func (d Zdate) TypeID() TypeID

func (*Zdate) UnmarshalZcl

func (d *Zdate) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zdate) Valid

func (d Zdate) Valid() bool

func (*Zdate) Values

func (d *Zdate) Values() []Val

type ZdoCmdID

type ZdoCmdID Zu16

func (ZdoCmdID) MarshalZcl

func (i ZdoCmdID) MarshalZcl() ([]byte, error)

func (*ZdoCmdID) UnmarshalZcl

func (i *ZdoCmdID) UnmarshalZcl(b []byte) ([]byte, error)

type ZdoCommand

type ZdoCommand interface {
	Val
	Arguments() []ArgDesc
	Cluster() ClusterID
	Values() []Val
	ID() ZdoCmdID
	Name() string
	String() string
	Handle(frame ReceivedZdpFrame, handler interface{}) (response ZdoCommand, found bool, err error)
}

type Zdouble

type Zdouble float64

Zdouble is Double precicion (0x = invalid). A/D = A

func (Zdouble) MarshalZcl

func (d Zdouble) MarshalZcl() ([]byte, error)

func (Zdouble) String

func (d Zdouble) String() string

func (Zdouble) TypeID

func (d Zdouble) TypeID() TypeID

func (*Zdouble) UnmarshalJSON

func (d *Zdouble) UnmarshalJSON(b []byte) error

func (*Zdouble) UnmarshalZcl

func (d *Zdouble) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zdouble) Values

func (d *Zdouble) Values() []Val

type ZdpFrame

type ZdpFrame interface {
	Packet
	// contains filtered or unexported methods
}

func NewZdpFrame

func NewZdpFrame(seq uint8, dstAddr Address, cmd ZdoCommand) (frame ZdpFrame, err error)

type ZdpHandler

type ZdpHandler interface {
	HandleZdp(ReceivedZdpFrame) (response ZdpFrame, err error)
}

type Zenum16

type Zenum16 uint16

Zenum16 is 16-bit enumeration (0xffff = invalid). A/D = D

func (Zenum16) MarshalZcl

func (e Zenum16) MarshalZcl() ([]byte, error)

func (Zenum16) String

func (e Zenum16) String() string

func (Zenum16) TypeID

func (e Zenum16) TypeID() TypeID

func (*Zenum16) UnmarshalJSON

func (e *Zenum16) UnmarshalJSON(b []byte) error

func (*Zenum16) UnmarshalZcl

func (e *Zenum16) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zenum16) Valid

func (e Zenum16) Valid() bool

func (*Zenum16) Values

func (e *Zenum16) Values() []Val

type Zenum8

type Zenum8 uint8

Zenum8 is 8-bit enumeration (0xff = invalid). A/D = D

func (Zenum8) MarshalZcl

func (e Zenum8) MarshalZcl() ([]byte, error)

func (Zenum8) String

func (e Zenum8) String() string

func (Zenum8) TypeID

func (e Zenum8) TypeID() TypeID

func (*Zenum8) UnmarshalJSON

func (e *Zenum8) UnmarshalJSON(b []byte) error

func (*Zenum8) UnmarshalZcl

func (e *Zenum8) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zenum8) Valid

func (e Zenum8) Valid() bool

func (*Zenum8) Values

func (e *Zenum8) Values() []Val

type Zfloat

type Zfloat float32

Zfloat is Single precicion (0x = invalid). A/D = A

func (Zfloat) MarshalZcl

func (f Zfloat) MarshalZcl() ([]byte, error)

func (Zfloat) String

func (f Zfloat) String() string

func (Zfloat) TypeID

func (f Zfloat) TypeID() TypeID

func (*Zfloat) UnmarshalJSON

func (f *Zfloat) UnmarshalJSON(b []byte) error

func (*Zfloat) UnmarshalZcl

func (f *Zfloat) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zfloat) Values

func (f *Zfloat) Values() []Val

type Zlcstring

type Zlcstring string

Zlcstring is Long character string (0xffff = invalid). A/D = D

func (Zlcstring) MarshalZcl

func (l Zlcstring) MarshalZcl() ([]byte, error)

func (Zlcstring) String

func (l Zlcstring) String() string

func (Zlcstring) TypeID

func (l Zlcstring) TypeID() TypeID

func (*Zlcstring) UnmarshalZcl

func (l *Zlcstring) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zlcstring) Values

func (l *Zlcstring) Values() []Val

type Zlist

type Zlist struct {
	Type    TypeID
	Content []Val
}

func (Zlist) MarshalZcl

func (b Zlist) MarshalZcl() ([]byte, error)

func (Zlist) String

func (b Zlist) String() string

func (Zlist) TypeID

func (b Zlist) TypeID() TypeID

func (*Zlist) UnmarshalZcl

func (b *Zlist) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zlist) Values

func (b *Zlist) Values() []Val

type Zlostring

type Zlostring string

Zlostring is Long octet string (0xffff = invalid). A/D = D

func (Zlostring) MarshalZcl

func (l Zlostring) MarshalZcl() ([]byte, error)

func (Zlostring) String

func (l Zlostring) String() string

func (Zlostring) TypeID

func (l Zlostring) TypeID() TypeID

func (*Zlostring) UnmarshalZcl

func (l *Zlostring) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zlostring) Values

func (l *Zlostring) Values() []Val

type Zoid

type Zoid uint32

Zoid is BACnet OID (0xffffffff = invalid). A/D = D

func (Zoid) MarshalZcl

func (o Zoid) MarshalZcl() ([]byte, error)

func (Zoid) String

func (o Zoid) String() string

func (Zoid) TypeID

func (o Zoid) TypeID() TypeID

func (*Zoid) UnmarshalZcl

func (o *Zoid) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zoid) Valid

func (o Zoid) Valid() bool

func (*Zoid) Values

func (o *Zoid) Values() []Val

type Zostring

type Zostring []byte

Zostring is Octet string (0xff = invalid). A/D = D

func (Zostring) MarshalZcl

func (o Zostring) MarshalZcl() ([]byte, error)

func (Zostring) String

func (o Zostring) String() string

func (Zostring) TypeID

func (o Zostring) TypeID() TypeID

func (*Zostring) UnmarshalZcl

func (o *Zostring) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zostring) Values

func (o *Zostring) Values() []Val

type Zs16

type Zs16 int16

Zs16 is Signed 16-bit integer (0x8000 = invalid). A/D = A

func (Zs16) MarshalZcl

func (s Zs16) MarshalZcl() ([]byte, error)

func (Zs16) String

func (s Zs16) String() string

func (Zs16) TypeID

func (s Zs16) TypeID() TypeID

func (*Zs16) UnmarshalJSON

func (s *Zs16) UnmarshalJSON(b []byte) error

func (*Zs16) UnmarshalZcl

func (s *Zs16) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zs16) Values

func (s *Zs16) Values() []Val

type Zs24

type Zs24 int32

Zs24 is Signed 24-bit integer (0x800000 = invalid). A/D = A

func (Zs24) MarshalZcl

func (s Zs24) MarshalZcl() ([]byte, error)

func (Zs24) String

func (s Zs24) String() string

func (Zs24) TypeID

func (s Zs24) TypeID() TypeID

func (*Zs24) UnmarshalJSON

func (s *Zs24) UnmarshalJSON(b []byte) error

func (*Zs24) UnmarshalZcl

func (s *Zs24) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zs24) Values

func (s *Zs24) Values() []Val

type Zs32

type Zs32 int32

Zs32 is Signed 32-bit integer (0x80000000 = invalid). A/D = A

func (Zs32) MarshalZcl

func (s Zs32) MarshalZcl() ([]byte, error)

func (Zs32) String

func (s Zs32) String() string

func (Zs32) TypeID

func (s Zs32) TypeID() TypeID

func (*Zs32) UnmarshalJSON

func (s *Zs32) UnmarshalJSON(b []byte) error

func (*Zs32) UnmarshalZcl

func (s *Zs32) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zs32) Values

func (s *Zs32) Values() []Val

type Zs40

type Zs40 int64

Zs40 is Signed 40-bit integer (0x8000000000 = invalid). A/D = A

func (Zs40) MarshalZcl

func (s Zs40) MarshalZcl() ([]byte, error)

func (Zs40) String

func (s Zs40) String() string

func (Zs40) TypeID

func (s Zs40) TypeID() TypeID

func (*Zs40) UnmarshalJSON

func (s *Zs40) UnmarshalJSON(b []byte) error

func (*Zs40) UnmarshalZcl

func (s *Zs40) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zs40) Values

func (s *Zs40) Values() []Val

type Zs48

type Zs48 int64

Zs48 is Signed 48-bit integer (0x800000000000 = invalid). A/D = A

func (Zs48) MarshalZcl

func (s Zs48) MarshalZcl() ([]byte, error)

func (Zs48) String

func (s Zs48) String() string

func (Zs48) TypeID

func (s Zs48) TypeID() TypeID

func (*Zs48) UnmarshalJSON

func (s *Zs48) UnmarshalJSON(b []byte) error

func (*Zs48) UnmarshalZcl

func (s *Zs48) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zs48) Values

func (s *Zs48) Values() []Val

type Zs56

type Zs56 int64

Zs56 is Signed 56-bit integer (0x80000000000000 = invalid). A/D = A

func (Zs56) MarshalZcl

func (s Zs56) MarshalZcl() ([]byte, error)

func (Zs56) String

func (s Zs56) String() string

func (Zs56) TypeID

func (s Zs56) TypeID() TypeID

func (*Zs56) UnmarshalJSON

func (s *Zs56) UnmarshalJSON(b []byte) error

func (*Zs56) UnmarshalZcl

func (s *Zs56) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zs56) Values

func (s *Zs56) Values() []Val

type Zs64

type Zs64 int64

Zs64 is Signed 64-bit integer (0x8000000000000000 = invalid). A/D = A

func (Zs64) MarshalZcl

func (s Zs64) MarshalZcl() ([]byte, error)

func (Zs64) String

func (s Zs64) String() string

func (Zs64) TypeID

func (s Zs64) TypeID() TypeID

func (*Zs64) UnmarshalJSON

func (s *Zs64) UnmarshalJSON(b []byte) error

func (*Zs64) UnmarshalZcl

func (s *Zs64) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zs64) Values

func (s *Zs64) Values() []Val

type Zs8

type Zs8 int8

Zs8 is Signed 8-bit integer (0x80 = invalid). A/D = A

func (Zs8) MarshalZcl

func (s Zs8) MarshalZcl() ([]byte, error)

func (Zs8) String

func (s Zs8) String() string

func (Zs8) TypeID

func (s Zs8) TypeID() TypeID

func (*Zs8) UnmarshalJSON

func (s *Zs8) UnmarshalJSON(b []byte) error

func (*Zs8) UnmarshalZcl

func (s *Zs8) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zs8) Values

func (s *Zs8) Values() []Val

type Zseckey

type Zseckey []byte

Zseckey is 128-bit security key. A/D = D

func (Zseckey) MarshalZcl

func (s Zseckey) MarshalZcl() ([]byte, error)

func (Zseckey) String

func (s Zseckey) String() string

func (Zseckey) TypeID

func (s Zseckey) TypeID() TypeID

func (*Zseckey) UnmarshalZcl

func (s *Zseckey) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zseckey) Values

func (s *Zseckey) Values() []Val

type Zsemi

type Zsemi float32

Zsemi is Semi-precicion (0x = invalid). A/D = A

func (Zsemi) MarshalZcl

func (s Zsemi) MarshalZcl() ([]byte, error)

func (Zsemi) String

func (s Zsemi) String() string

func (Zsemi) TypeID

func (s Zsemi) TypeID() TypeID

func (*Zsemi) UnmarshalJSON

func (s *Zsemi) UnmarshalJSON(b []byte) error

func (*Zsemi) UnmarshalZcl

func (s *Zsemi) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zsemi) Values

func (s *Zsemi) Values() []Val

type Zset

type Zset struct {
	Type    TypeID
	Content []Val
}

Zset is Set (0xffff = invalid). A/D = D

func (Zset) MarshalZcl

func (s Zset) MarshalZcl() ([]byte, error)

func (Zset) String

func (s Zset) String() string

func (Zset) TypeID

func (s Zset) TypeID() TypeID

func (*Zset) UnmarshalZcl

func (s *Zset) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zset) Values

func (s *Zset) Values() []Val

type Zstruct

type Zstruct []StructField

Zstruct is Structure (0xffff = invalid). A/D = D

func (Zstruct) MarshalZcl

func (s Zstruct) MarshalZcl() ([]byte, error)

func (Zstruct) String

func (s Zstruct) String() string

func (Zstruct) TypeID

func (s Zstruct) TypeID() TypeID

func (*Zstruct) UnmarshalZcl

func (s *Zstruct) UnmarshalZcl(buf []byte) ([]byte, error)

func (*Zstruct) Values

func (s *Zstruct) Values() []Val

type Ztime

type Ztime uint32

Ztime is Time of day (0xffffffff = invalid). A/D = A

func (Ztime) MarshalZcl

func (t Ztime) MarshalZcl() ([]byte, error)

func (*Ztime) SetTime

func (t *Ztime) SetTime(hr, min, sec, hundreths int)

func (Ztime) String

func (t Ztime) String() string

func (Ztime) TypeID

func (t Ztime) TypeID() TypeID

func (*Ztime) UnmarshalJSON added in v0.2.0

func (t *Ztime) UnmarshalJSON(b []byte) error

func (*Ztime) UnmarshalZcl

func (t *Ztime) UnmarshalZcl(buf []byte) ([]byte, error)

func (Ztime) Valid

func (t Ztime) Valid() bool

func (*Ztime) Values

func (t *Ztime) Values() []Val

type Zu16

type Zu16 uint16

Zu16 is Unsigned 16-bit integer (0xffff = invalid). A/D = A

func (Zu16) MarshalZcl

func (u Zu16) MarshalZcl() ([]byte, error)

func (Zu16) String

func (u Zu16) String() string

func (Zu16) TypeID

func (u Zu16) TypeID() TypeID

func (*Zu16) UnmarshalJSON

func (u *Zu16) UnmarshalJSON(b []byte) error

func (*Zu16) UnmarshalZcl

func (u *Zu16) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zu16) Valid

func (u Zu16) Valid() bool

func (*Zu16) Values

func (u *Zu16) Values() []Val

type Zu24

type Zu24 uint32

Zu24 is Unsigned 24-bit integer (0xffffff = invalid). A/D = A

func (Zu24) MarshalZcl

func (u Zu24) MarshalZcl() ([]byte, error)

func (Zu24) String

func (u Zu24) String() string

func (Zu24) TypeID

func (u Zu24) TypeID() TypeID

func (*Zu24) UnmarshalJSON

func (u *Zu24) UnmarshalJSON(b []byte) error

func (*Zu24) UnmarshalZcl

func (u *Zu24) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zu24) Valid

func (u Zu24) Valid() bool

func (*Zu24) Values

func (u *Zu24) Values() []Val

type Zu32

type Zu32 uint32

Zu32 is Unsigned 32-bit integer (0xffffffff = invalid). A/D = A

func (Zu32) MarshalZcl

func (u Zu32) MarshalZcl() ([]byte, error)

func (Zu32) String

func (u Zu32) String() string

func (Zu32) TypeID

func (u Zu32) TypeID() TypeID

func (*Zu32) UnmarshalJSON

func (u *Zu32) UnmarshalJSON(b []byte) error

func (*Zu32) UnmarshalZcl

func (u *Zu32) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zu32) Valid

func (u Zu32) Valid() bool

func (*Zu32) Values

func (u *Zu32) Values() []Val

type Zu40

type Zu40 uint64

Zu40 is Unsigned 40-bit integer (0xffffffffff = invalid). A/D = A

func (Zu40) MarshalZcl

func (u Zu40) MarshalZcl() ([]byte, error)

func (Zu40) String

func (u Zu40) String() string

func (Zu40) TypeID

func (u Zu40) TypeID() TypeID

func (*Zu40) UnmarshalJSON

func (u *Zu40) UnmarshalJSON(b []byte) error

func (*Zu40) UnmarshalZcl

func (u *Zu40) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zu40) Valid

func (u Zu40) Valid() bool

func (*Zu40) Values

func (u *Zu40) Values() []Val

type Zu48

type Zu48 uint64

Zu48 is Unsigned 48-bit integer (0xffffffffffff = invalid). A/D = A

func (Zu48) MarshalZcl

func (u Zu48) MarshalZcl() ([]byte, error)

func (Zu48) String

func (u Zu48) String() string

func (Zu48) TypeID

func (u Zu48) TypeID() TypeID

func (*Zu48) UnmarshalJSON

func (u *Zu48) UnmarshalJSON(b []byte) error

func (*Zu48) UnmarshalZcl

func (u *Zu48) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zu48) Valid

func (u Zu48) Valid() bool

func (*Zu48) Values

func (u *Zu48) Values() []Val

type Zu56

type Zu56 uint64

Zu56 is Unsigned 56-bit integer (0xffffffffffffff = invalid). A/D = A

func (Zu56) MarshalZcl

func (u Zu56) MarshalZcl() ([]byte, error)

func (Zu56) String

func (u Zu56) String() string

func (Zu56) TypeID

func (u Zu56) TypeID() TypeID

func (*Zu56) UnmarshalJSON

func (u *Zu56) UnmarshalJSON(b []byte) error

func (*Zu56) UnmarshalZcl

func (u *Zu56) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zu56) Valid

func (u Zu56) Valid() bool

func (*Zu56) Values

func (u *Zu56) Values() []Val

type Zu64

type Zu64 uint64

Zu64 is Unsigned 64-bit integer (0xffffffffffffffff = invalid). A/D = A

func (Zu64) MarshalZcl

func (u Zu64) MarshalZcl() ([]byte, error)

func (Zu64) String

func (u Zu64) String() string

func (Zu64) TypeID

func (u Zu64) TypeID() TypeID

func (*Zu64) UnmarshalJSON

func (u *Zu64) UnmarshalJSON(b []byte) error

func (*Zu64) UnmarshalZcl

func (u *Zu64) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zu64) Valid

func (u Zu64) Valid() bool

func (*Zu64) Values

func (u *Zu64) Values() []Val

type Zu8

type Zu8 uint8

Zu8 is Unsigned 8-bit integer (0xff = invalid). A/D = A

func (Zu8) MarshalJSON

func (u Zu8) MarshalJSON() ([]byte, error)

func (Zu8) MarshalZcl

func (u Zu8) MarshalZcl() ([]byte, error)

func (Zu8) String

func (u Zu8) String() string

func (Zu8) TypeID

func (u Zu8) TypeID() TypeID

func (*Zu8) UnmarshalJSON

func (u *Zu8) UnmarshalJSON(b []byte) error

func (*Zu8) UnmarshalZcl

func (u *Zu8) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zu8) Valid

func (u Zu8) Valid() bool

func (*Zu8) Values

func (u *Zu8) Values() []Val

type Zuid

type Zuid uint64

Zuid is IEEE address (0xffffffffffffffff = invalid). A/D = D

func IEEE

func IEEE(addr net.HardwareAddr) Zuid

func (Zuid) HWAddr

func (u Zuid) HWAddr() net.HardwareAddr

func (Zuid) MarshalJSON

func (u Zuid) MarshalJSON() ([]byte, error)

func (Zuid) MarshalZcl

func (u Zuid) MarshalZcl() ([]byte, error)

func (Zuid) String

func (u Zuid) String() string

func (Zuid) TypeID

func (u Zuid) TypeID() TypeID

func (*Zuid) UnmarshalJSON

func (u *Zuid) UnmarshalJSON(b []byte) error

func (*Zuid) UnmarshalZcl

func (u *Zuid) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zuid) Valid

func (u Zuid) Valid() bool

func (*Zuid) Values

func (u *Zuid) Values() []Val

type Zutc

type Zutc uint32

Zutc is UTCTime (0xffffffff = invalid). A/D = A

func (Zutc) MarshalZcl

func (u Zutc) MarshalZcl() ([]byte, error)

func (Zutc) String

func (u Zutc) String() string

func (Zutc) Time

func (u Zutc) Time() time.Time

func (Zutc) TypeID

func (u Zutc) TypeID() TypeID

func (*Zutc) UnmarshalZcl

func (u *Zutc) UnmarshalZcl(buf []byte) ([]byte, error)

func (Zutc) Valid

func (u Zutc) Valid() bool

func (*Zutc) Values

func (u *Zutc) Values() []Val

Directories

Path Synopsis
general
provides general/common attributes and operations for most zigbee devices
provides general/common attributes and operations for most zigbee devices
ias
measurement
provides generic measurement and sensing interfaces
provides generic measurement and sensing interfaces
cmd
half
Package half is an IEEE 754 binary16 half precision format.
Package half is an IEEE 754 binary16 half precision format.

Jump to

Keyboard shortcuts

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