Developing with ZBOSS for Zigbee

Modules

 General attributes' description
 Types and macros shared among all attributes' definitions.Use ZB_ZCL_SET_ATTRIBUTE.
 
 General frame description
 Types and macros required for ZCL frame manipulations.
 
 Fill ZCL packet low-level API
 Types and macros shared fill Fill ZCL packet.
 

Data Structures

struct  zb_zcl_cluster_desc_s
 ZCL cluster description. More...
 

Macros

#define ZB_ZCL_HI_MAX_PAYLOAD_SIZE   66U
 
#define ZB_ZCL_HI_WO_IEEE_MAX_PAYLOAD_SIZE   82U
 
#define ZB_ZCL_IS_CLUSTER_MANUF_SPEC(_cluster_id)   ((_cluster_id) > 0xfbff)
 Check whether cluster is manufacturer specific.
 
#define ZB_ZCL_MANUF_CODE_INVALID   0x0000
 Internal invalid manufacturer code value.
 
#define ZB_ZCL_GLOBAL_CLUSTER_VERSION_DEFAULT   1
 ZCL global attribute: cluster version returned by default. Used if the GLOBAL_CLUSTER_REVISION attribute is undefined for the cluster/role.
 
#define ZB_ZCL_ATTR_GET16(value)   (*((zb_uint16_t *)value))
 
#define ZB_ZCL_ATTR_GETS16(value)   (*((zb_int16_t *)value))
 
#define ZB_ZCL_ATTR_GET32(value)   (*((zb_uint32_t *)value))
 
#define ZB_ZCL_ATTR_GETS32(value)   (*((zb_int32_t *)value))
 
#define ZB_ZCL_ATTR_GET24(value)   (*((zb_int24_t *)value))
 
#define ZB_ZCL_ATTR_GET48(value)   (*((zb_uint48_t *)value))
 

Typedefs

typedef void(* zb_zcl_cluster_init_t) (void)
 ZCL Cluster Init Handler. This handler is called on registering device context (ZB_AF_REGISTER_DEVICE_CTX). Initialization of the cluster should include zb_zcl_add_cluster_handlers call, if any of the cluster handlers are implemented. More...
 
typedef zb_bool_t(* zb_zcl_cluster_handler_t) (zb_uint8_t param)
 ZCL Cluster Command Handler. This handler is called on incoming ZCL command for corresponding cluster. More...
 
typedef zb_ret_t(* zb_zcl_cluster_check_value_t) (zb_uint16_t attr_id, zb_uint8_t endpoint, zb_uint8_t *value)
 ZCL Cluster Check Value Handler. This handler is called before attribute change (for corresponding cluster) and checks if new value is in correct range and can be applied. More...
 
typedef void(* zb_zcl_cluster_write_attr_hook_t) (zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint8_t *new_value)
 ZCL Cluster Write Attribute Hook Handler. This handler is called before attribute change (if any cluster-specific action needs to be bound to attribute change, it can be placed in this handler). More...
 
typedef struct zb_zcl_cluster_desc_s zb_zcl_cluster_desc_t
 ZCL cluster description.
 
typedef zb_uint16_t zb_zcl_cluster_id_t
 Type for cluster roles in message exchange. More...
 
typedef enum zb_zcl_parse_status_e zb_zcl_parse_status_t
 Parse frame operation status.
 
typedef enum zb_zcl_attribute_reporting_status_e zb_zcl_attribute_reporting_status_t
 Attribute Reporting Status.
 
typedef zb_uint8_t zb_zcl_status_t
 Type for ZCL status values. More...
 
typedef void(* zb_zcl_modify_attr_value_cb_t) (zb_uint8_t ep, zb_uint16_t cluster_id, zb_uint16_t attr_id, zb_uint8_t *value)
 Informs application that some attribute value is being updated by Write attribute command. More...
 

Enumerations

enum  zb_zcl_parse_status_e { ZB_ZCL_PARSE_STATUS_SUCCESS, ZB_ZCL_PARSE_STATUS_FAILURE }
 Parse frame operation status. More...
 
enum  zb_zcl_attribute_reporting_status_e { ZB_ZCL_AR_STATUS_PENDING =0x00, ZB_ZCL_AR_STATUS_COMPLETE =0x01 }
 Attribute Reporting Status. More...
 

Functions

zb_ret_t zb_zcl_add_cluster_handlers (zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_zcl_cluster_check_value_t cluster_check_value, zb_zcl_cluster_write_attr_hook_t cluster_write_attr_hook, zb_zcl_cluster_handler_t cluster_handler)
 Add ZCL cluster handlers for Cluster ID and Cluster Role. More...
 

Cluster roles in message exchange

Note: These values were members of enum zb_zcl_cluster_role_e type but were converted to a set of macros due to MISRA violations.

#define ZB_ZCL_CLUSTER_SERVER_ROLE   0x01U
 
#define ZB_ZCL_CLUSTER_CLIENT_ROLE   0x02U
 
#define ZB_ZCL_CLUSTER_ANY_ROLE   0x03U
 
#define ZB_ZCL_REVERT_CLUSTER_ROLE(_d)
 

ZCL cluster identifiers

See also
ZCL spec, subclause 2.2.2
#define ZB_ZCL_CLUSTER_ID_BASIC   0x0000U
 
#define ZB_ZCL_CLUSTER_ID_POWER_CONFIG   0x0001U
 
#define ZB_ZCL_CLUSTER_ID_DEVICE_TEMP_CONFIG   0x0002U
 
#define ZB_ZCL_CLUSTER_ID_IDENTIFY   0x0003U
 
#define ZB_ZCL_CLUSTER_ID_GROUPS   0x0004U
 
#define ZB_ZCL_CLUSTER_ID_SCENES   0x0005U
 
#define ZB_ZCL_CLUSTER_ID_ON_OFF   0x0006U
 
#define ZB_ZCL_CLUSTER_ID_ON_OFF_SWITCH_CONFIG   0x0007U
 
#define ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL   0x0008U
 
#define ZB_ZCL_CLUSTER_ID_ALARMS   0x0009U
 
#define ZB_ZCL_CLUSTER_ID_TIME   0x000aU
 
#define ZB_ZCL_CLUSTER_ID_RSSI_LOCATION   0x000bU
 
#define ZB_ZCL_CLUSTER_ID_ANALOG_INPUT   0x000cU
 
#define ZB_ZCL_CLUSTER_ID_ANALOG_OUTPUT   0x000dU
 
#define ZB_ZCL_CLUSTER_ID_ANALOG_VALUE   0x000eU
 
#define ZB_ZCL_CLUSTER_ID_BINARY_INPUT   0x000fU
 
#define ZB_ZCL_CLUSTER_ID_BINARY_OUTPUT   0x0010U
 
#define ZB_ZCL_CLUSTER_ID_BINARY_VALUE   0x0011U
 
#define ZB_ZCL_CLUSTER_ID_MULTI_INPUT   0x0012U
 
#define ZB_ZCL_CLUSTER_ID_MULTI_OUTPUT   0x0013U
 
#define ZB_ZCL_CLUSTER_ID_MULTI_VALUE   0x0014U
 
#define ZB_ZCL_CLUSTER_ID_COMMISSIONING   0x0015U
 
#define ZB_ZCL_CLUSTER_ID_OTA_UPGRADE   0x0019U
 
#define ZB_ZCL_CLUSTER_ID_POLL_CONTROL   0x0020U
 
#define ZB_ZCL_CLUSTER_ID_GREEN_POWER   0x0021U
 
#define ZB_ZCL_CLUSTER_ID_KEEP_ALIVE   0x0025U
 
#define ZB_ZCL_CLUSTER_ID_SHADE_CONFIG   0x0100U
 
#define ZB_ZCL_CLUSTER_ID_DOOR_LOCK   0x0101U
 
#define ZB_ZCL_CLUSTER_ID_WINDOW_COVERING   0x0102U
 
#define ZB_ZCL_CLUSTER_ID_PUMP_CONFIG_CONTROL   0x200U
 
#define ZB_ZCL_CLUSTER_ID_THERMOSTAT   0x201U
 
#define ZB_ZCL_CLUSTER_ID_FAN_CONTROL   0x202U
 
#define ZB_ZCL_CLUSTER_ID_DEHUMID_CONTROL   0x203U
 
#define ZB_ZCL_CLUSTER_ID_THERMOSTAT_UI_CONFIG   0x204U
 
#define ZB_ZCL_CLUSTER_ID_COLOR_CONTROL   0x0300U
 
#define ZB_ZCL_CLUSTER_ID_BALLAST_CONFIG   0x0301U
 
#define ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT   0x0400U
 
#define ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT   0x0402U
 
#define ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT   0x0403U
 
#define ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT   0x0405U
 
#define ZB_ZCL_CLUSTER_ID_OCCUPANCY_SENSING   0x0406U
 
#define ZB_ZCL_CLUSTER_ID_IAS_ZONE   0x0500U
 
#define ZB_ZCL_CLUSTER_ID_IAS_ACE   0x0501U
 
#define ZB_ZCL_CLUSTER_ID_IAS_WD   0x0502U
 
#define ZB_ZCL_CLUSTER_ID_PRICE   0x0700U
 
#define ZB_ZCL_CLUSTER_ID_DRLC   0x0701U
 
#define ZB_ZCL_CLUSTER_ID_METERING   0x0702U
 
#define ZB_ZCL_CLUSTER_ID_MESSAGING   0x0703U
 
#define ZB_ZCL_CLUSTER_ID_TUNNELING   0x0704U
 
#define ZB_ZCL_CLUSTER_ID_PREPAYMENT   0x0705U
 
#define ZB_ZCL_CLUSTER_ID_ENERGY_MANAGEMENT   0x0706U
 
#define ZB_ZCL_CLUSTER_ID_CALENDAR   0x0707U
 
#define ZB_ZCL_CLUSTER_ID_DEVICE_MANAGEMENT   0x0708U
 
#define ZB_ZCL_CLUSTER_ID_EVENTS   0x0709U
 
#define ZB_ZCL_CLUSTER_ID_MDU_PAIRING   0x070AU
 
#define ZB_ZCL_CLUSTER_ID_SUB_GHZ   0x070BU
 
#define ZB_ZCL_CLUSTER_ID_DAILY_SCHEDULE   0x070DU
 
#define ZB_ZCL_CLUSTER_ID_KEY_ESTABLISHMENT   0x0800U
 
#define ZB_ZCL_CLUSTER_ID_APPLIANCE_EVENTS_AND_ALERTS   0x0b02U
 
#define ZB_ZCL_CLUSTER_ID_ELECTRICAL_MEASUREMENT   0x0b04U
 
#define ZB_ZCL_CLUSTER_ID_DIAGNOSTICS   0x0b05U
 
#define ZB_ZCL_CLUSTER_ID_WWAH   0xFC57U
 
#define ZB_ZCL_CLUSTER_ID_TUNNEL   0xfc00U
 
#define ZB_ZCL_CLUSTER_ID_IR_BLASTER   0xfc01U
 
#define ZB_ZCL_CLUSTER_ID_CUSTOM_ATTR   0xffeeU
 
#define ZB_ZCL_CLUSTER_ID_METER_IDENTIFICATION   0x0B01U
 

ZCL status values

See also
ZCL spec, subclause 2.5.3
Note
The enumeration does not contain statuses not used in ZB HA profile
#define ZB_ZCL_STATUS_SUCCESS   0x00U
 
#define ZB_ZCL_STATUS_FAIL   0x01U
 
#define ZB_ZCL_STATUS_NOT_AUTHORIZED   0x7EU
 
#define ZB_ZCL_STATUS_MALFORMED_CMD   0x80U
 
#define ZB_ZCL_STATUS_UNSUP_CLUST_CMD   0x81U
 
#define ZB_ZCL_STATUS_UNSUP_GEN_CMD   0x82U
 
#define ZB_ZCL_STATUS_UNSUP_MANUF_CLUST_CMD   0x83U
 
#define ZB_ZCL_STATUS_UNSUP_MANUF_GEN_CMD   0x84U
 
#define ZB_ZCL_STATUS_INVALID_FIELD   0x85U
 
#define ZB_ZCL_STATUS_UNSUP_ATTRIB   0x86U
 
#define ZB_ZCL_STATUS_INVALID_VALUE   0x87U
 
#define ZB_ZCL_STATUS_READ_ONLY   0x88U
 
#define ZB_ZCL_STATUS_INSUFF_SPACE   0x89U
 
#define ZB_ZCL_STATUS_DUPE_EXISTS   0x8aU
 
#define ZB_ZCL_STATUS_NOT_FOUND   0x8bU
 
#define ZB_ZCL_STATUS_UNREPORTABLE_ATTRIB   0x8cU
 
#define ZB_ZCL_STATUS_INVALID_TYPE   0x8dU
 
#define ZB_ZCL_STATUS_WRITE_ONLY   0x8fU
 
#define ZB_ZCL_STATUS_INCONSISTENT   0x92U
 
#define ZB_ZCL_STATUS_ACTION_DENIED   0x93U
 
#define ZB_ZCL_STATUS_TIMEOUT   0x94U
 
#define ZB_ZCL_STATUS_ABORT   0x95U
 
#define ZB_ZCL_STATUS_INVALID_IMAGE   0x96U
 
#define ZB_ZCL_STATUS_WAIT_FOR_DATA   0x97U
 
#define ZB_ZCL_STATUS_NO_IMAGE_AVAILABLE   0x98U
 
#define ZB_ZCL_STATUS_REQUIRE_MORE_IMAGE   0x99U
 
#define ZB_ZCL_STATUS_NOTIFICATION_PENDING   0x9AU
 
#define ZB_ZCL_STATUS_HW_FAIL   0xc0U
 
#define ZB_ZCL_STATUS_SW_FAIL   0xc1U
 
#define ZB_ZCL_STATUS_CALIB_ERR   0xc2U
 
#define ZB_ZCL_STATUS_UNSUP_CLUST   0xc3U
 
#define ZB_ZCL_STATUS_LIMIT_REACHED   0xc4U
 

Detailed Description

The section contains enumerations defining cluster identifiers and inter-device operation statuses, and a callback type used to notify application on attribute value change (see Write attributes command description).

Macro Definition Documentation

◆ ZB_ZCL_CLUSTER_ANY_ROLE

#define ZB_ZCL_CLUSTER_ANY_ROLE   0x03U

Internal value - used for searching any role (on the moment when cluster role is not known yet).

◆ ZB_ZCL_CLUSTER_CLIENT_ROLE

#define ZB_ZCL_CLUSTER_CLIENT_ROLE   0x02U

Client cluster role

◆ ZB_ZCL_CLUSTER_ID_ALARMS

#define ZB_ZCL_CLUSTER_ID_ALARMS   0x0009U

Alarms cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_ANALOG_INPUT

#define ZB_ZCL_CLUSTER_ID_ANALOG_INPUT   0x000cU

Analog input (basic) cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_ANALOG_OUTPUT

#define ZB_ZCL_CLUSTER_ID_ANALOG_OUTPUT   0x000dU

Analog output (basic) cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_ANALOG_VALUE

#define ZB_ZCL_CLUSTER_ID_ANALOG_VALUE   0x000eU

Analog value (basic) cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_APPLIANCE_EVENTS_AND_ALERTS

#define ZB_ZCL_CLUSTER_ID_APPLIANCE_EVENTS_AND_ALERTS   0x0b02U

Appliance events and alerts cluster identifier

◆ ZB_ZCL_CLUSTER_ID_BALLAST_CONFIG

#define ZB_ZCL_CLUSTER_ID_BALLAST_CONFIG   0x0301U

Ballast configuration cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_BASIC

#define ZB_ZCL_CLUSTER_ID_BASIC   0x0000U

Basic cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_BINARY_INPUT

#define ZB_ZCL_CLUSTER_ID_BINARY_INPUT   0x000fU

Binary input (basic) cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_BINARY_OUTPUT

#define ZB_ZCL_CLUSTER_ID_BINARY_OUTPUT   0x0010U

Binary output (basic) cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_BINARY_VALUE

#define ZB_ZCL_CLUSTER_ID_BINARY_VALUE   0x0011U

Binary value (basic) cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_CALENDAR

#define ZB_ZCL_CLUSTER_ID_CALENDAR   0x0707U

Calendar cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_COLOR_CONTROL

#define ZB_ZCL_CLUSTER_ID_COLOR_CONTROL   0x0300U

Color control cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_COMMISSIONING

#define ZB_ZCL_CLUSTER_ID_COMMISSIONING   0x0015U

Commissioning cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_CUSTOM_ATTR

#define ZB_ZCL_CLUSTER_ID_CUSTOM_ATTR   0xffeeU

Custom Attributes

◆ ZB_ZCL_CLUSTER_ID_DAILY_SCHEDULE

#define ZB_ZCL_CLUSTER_ID_DAILY_SCHEDULE   0x070DU

Daily Schedule cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_DEHUMID_CONTROL

#define ZB_ZCL_CLUSTER_ID_DEHUMID_CONTROL   0x203U

Dehumidification control cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_DEVICE_MANAGEMENT

#define ZB_ZCL_CLUSTER_ID_DEVICE_MANAGEMENT   0x0708U

Device Management cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_DEVICE_TEMP_CONFIG

#define ZB_ZCL_CLUSTER_ID_DEVICE_TEMP_CONFIG   0x0002U

Device temperature configuration cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_DIAGNOSTICS

#define ZB_ZCL_CLUSTER_ID_DIAGNOSTICS   0x0b05U

Home Automation Diagnostics

◆ ZB_ZCL_CLUSTER_ID_DOOR_LOCK

#define ZB_ZCL_CLUSTER_ID_DOOR_LOCK   0x0101U

Door lock cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_DRLC

#define ZB_ZCL_CLUSTER_ID_DRLC   0x0701U

Demand-Response cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_ELECTRICAL_MEASUREMENT

#define ZB_ZCL_CLUSTER_ID_ELECTRICAL_MEASUREMENT   0x0b04U

Electrical Measurement cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_ENERGY_MANAGEMENT

#define ZB_ZCL_CLUSTER_ID_ENERGY_MANAGEMENT   0x0706U

Energy Management cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_EVENTS

#define ZB_ZCL_CLUSTER_ID_EVENTS   0x0709U

Events cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_FAN_CONTROL

#define ZB_ZCL_CLUSTER_ID_FAN_CONTROL   0x202U

Fan control cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_GREEN_POWER

#define ZB_ZCL_CLUSTER_ID_GREEN_POWER   0x0021U

Green Power cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_GROUPS

#define ZB_ZCL_CLUSTER_ID_GROUPS   0x0004U

Groups cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_IAS_ACE

#define ZB_ZCL_CLUSTER_ID_IAS_ACE   0x0501U

IAS ACE cluster identifier

◆ ZB_ZCL_CLUSTER_ID_IAS_WD

#define ZB_ZCL_CLUSTER_ID_IAS_WD   0x0502U

IAS WD cluster identifier

◆ ZB_ZCL_CLUSTER_ID_IAS_ZONE

#define ZB_ZCL_CLUSTER_ID_IAS_ZONE   0x0500U

IAS Zone cluster identifier

◆ ZB_ZCL_CLUSTER_ID_IDENTIFY

#define ZB_ZCL_CLUSTER_ID_IDENTIFY   0x0003U

Identify cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT

#define ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT   0x0400U

Illuminance measurement

◆ ZB_ZCL_CLUSTER_ID_IR_BLASTER

#define ZB_ZCL_CLUSTER_ID_IR_BLASTER   0xfc01U

Manufacturer specific IR Blaster cluster

◆ ZB_ZCL_CLUSTER_ID_KEEP_ALIVE

#define ZB_ZCL_CLUSTER_ID_KEEP_ALIVE   0x0025U

Keep Alive cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_KEY_ESTABLISHMENT

#define ZB_ZCL_CLUSTER_ID_KEY_ESTABLISHMENT   0x0800U

Key Establishment cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL

#define ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL   0x0008U

Level control cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_MDU_PAIRING

#define ZB_ZCL_CLUSTER_ID_MDU_PAIRING   0x070AU

MDU Pairing cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_MESSAGING

#define ZB_ZCL_CLUSTER_ID_MESSAGING   0x0703U

Messaging cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_METER_IDENTIFICATION

#define ZB_ZCL_CLUSTER_ID_METER_IDENTIFICATION   0x0B01U

Meter Identification cluster identifier

◆ ZB_ZCL_CLUSTER_ID_METERING

#define ZB_ZCL_CLUSTER_ID_METERING   0x0702U

Metering cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_MULTI_INPUT

#define ZB_ZCL_CLUSTER_ID_MULTI_INPUT   0x0012U

Multistate input (basic) cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_MULTI_OUTPUT

#define ZB_ZCL_CLUSTER_ID_MULTI_OUTPUT   0x0013U

Multistate output (basic) cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_MULTI_VALUE

#define ZB_ZCL_CLUSTER_ID_MULTI_VALUE   0x0014U

Multistate value (basic) cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_OCCUPANCY_SENSING

#define ZB_ZCL_CLUSTER_ID_OCCUPANCY_SENSING   0x0406U

Occupancy sensing

◆ ZB_ZCL_CLUSTER_ID_ON_OFF

#define ZB_ZCL_CLUSTER_ID_ON_OFF   0x0006U

On/Off cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_ON_OFF_SWITCH_CONFIG

#define ZB_ZCL_CLUSTER_ID_ON_OFF_SWITCH_CONFIG   0x0007U

On/Off switch configuration cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_OTA_UPGRADE

#define ZB_ZCL_CLUSTER_ID_OTA_UPGRADE   0x0019U

Over The Air cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_POLL_CONTROL

#define ZB_ZCL_CLUSTER_ID_POLL_CONTROL   0x0020U

Poll control cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_POWER_CONFIG

#define ZB_ZCL_CLUSTER_ID_POWER_CONFIG   0x0001U

Power configuration cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_PREPAYMENT

#define ZB_ZCL_CLUSTER_ID_PREPAYMENT   0x0705U

Prepayment cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT

#define ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT   0x0403U

Pressure measurement

◆ ZB_ZCL_CLUSTER_ID_PRICE

#define ZB_ZCL_CLUSTER_ID_PRICE   0x0700U

Price cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_PUMP_CONFIG_CONTROL

#define ZB_ZCL_CLUSTER_ID_PUMP_CONFIG_CONTROL   0x200U

Pump configuration and control cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT

#define ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT   0x0405U

Relative humidity measurement

◆ ZB_ZCL_CLUSTER_ID_RSSI_LOCATION

#define ZB_ZCL_CLUSTER_ID_RSSI_LOCATION   0x000bU

RSSI location cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_SCENES

#define ZB_ZCL_CLUSTER_ID_SCENES   0x0005U

Scenes cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_SHADE_CONFIG

#define ZB_ZCL_CLUSTER_ID_SHADE_CONFIG   0x0100U

Shade configuration cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_SUB_GHZ

#define ZB_ZCL_CLUSTER_ID_SUB_GHZ   0x070BU

Sub-GHz cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT

#define ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT   0x0402U

Temperature measurement

◆ ZB_ZCL_CLUSTER_ID_THERMOSTAT

#define ZB_ZCL_CLUSTER_ID_THERMOSTAT   0x201U

Thermostat cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_THERMOSTAT_UI_CONFIG

#define ZB_ZCL_CLUSTER_ID_THERMOSTAT_UI_CONFIG   0x204U

Thermostat user interface configuration cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_TIME

#define ZB_ZCL_CLUSTER_ID_TIME   0x000aU

Time cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_TUNNEL

#define ZB_ZCL_CLUSTER_ID_TUNNEL   0xfc00U

Manufacturer specific Tunnel cluster

◆ ZB_ZCL_CLUSTER_ID_TUNNELING

#define ZB_ZCL_CLUSTER_ID_TUNNELING   0x0704U

Tunneling cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_WINDOW_COVERING

#define ZB_ZCL_CLUSTER_ID_WINDOW_COVERING   0x0102U

Window covering cluster identifier.

◆ ZB_ZCL_CLUSTER_ID_WWAH

#define ZB_ZCL_CLUSTER_ID_WWAH   0xFC57U

Works with All Hubs cluster identifier

◆ ZB_ZCL_CLUSTER_SERVER_ROLE

#define ZB_ZCL_CLUSTER_SERVER_ROLE   0x01U

Server cluster role

◆ ZB_ZCL_HI_MAX_PAYLOAD_SIZE

#define ZB_ZCL_HI_MAX_PAYLOAD_SIZE   66U

ZCL payload maximum size; is used to calculate number of available bytes in variable-size commands

Maximal payload size

◆ ZB_ZCL_HI_WO_IEEE_MAX_PAYLOAD_SIZE

#define ZB_ZCL_HI_WO_IEEE_MAX_PAYLOAD_SIZE   82U

Maximal payload size without long address sending

◆ ZB_ZCL_REVERT_CLUSTER_ROLE

#define ZB_ZCL_REVERT_CLUSTER_ROLE (   _d)

◆ ZB_ZCL_STATUS_ABORT

#define ZB_ZCL_STATUS_ABORT   0x95U

Abort

◆ ZB_ZCL_STATUS_ACTION_DENIED

#define ZB_ZCL_STATUS_ACTION_DENIED   0x93U

The credentials presented by the device sending the command are not sufficient to perform this action.

◆ ZB_ZCL_STATUS_CALIB_ERR

#define ZB_ZCL_STATUS_CALIB_ERR   0xc2U

Calibration error

◆ ZB_ZCL_STATUS_DUPE_EXISTS

#define ZB_ZCL_STATUS_DUPE_EXISTS   0x8aU

Duplicate exists

◆ ZB_ZCL_STATUS_FAIL

#define ZB_ZCL_STATUS_FAIL   0x01U

ZCL Fail

◆ ZB_ZCL_STATUS_HW_FAIL

#define ZB_ZCL_STATUS_HW_FAIL   0xc0U

Hardware failure

◆ ZB_ZCL_STATUS_INCONSISTENT

#define ZB_ZCL_STATUS_INCONSISTENT   0x92U

Supplied values are inconsistent

◆ ZB_ZCL_STATUS_INSUFF_SPACE

#define ZB_ZCL_STATUS_INSUFF_SPACE   0x89U

Insufficient space

◆ ZB_ZCL_STATUS_INVALID_FIELD

#define ZB_ZCL_STATUS_INVALID_FIELD   0x85U

Invalid field

◆ ZB_ZCL_STATUS_INVALID_IMAGE

#define ZB_ZCL_STATUS_INVALID_IMAGE   0x96U

Invalid OTA upgrade image

◆ ZB_ZCL_STATUS_INVALID_TYPE

#define ZB_ZCL_STATUS_INVALID_TYPE   0x8dU

Invalid type

◆ ZB_ZCL_STATUS_INVALID_VALUE

#define ZB_ZCL_STATUS_INVALID_VALUE   0x87U

Invalid value

◆ ZB_ZCL_STATUS_LIMIT_REACHED

#define ZB_ZCL_STATUS_LIMIT_REACHED   0xc4U

Cluster is not found on the target endpoint

◆ ZB_ZCL_STATUS_MALFORMED_CMD

#define ZB_ZCL_STATUS_MALFORMED_CMD   0x80U

Malformed command

◆ ZB_ZCL_STATUS_NOT_AUTHORIZED

#define ZB_ZCL_STATUS_NOT_AUTHORIZED   0x7EU

Server is not authorized to upgrade the client

◆ ZB_ZCL_STATUS_NOT_FOUND

#define ZB_ZCL_STATUS_NOT_FOUND   0x8bU

Not found

◆ ZB_ZCL_STATUS_NOTIFICATION_PENDING

#define ZB_ZCL_STATUS_NOTIFICATION_PENDING   0x9AU

The command has been received and is being processed.

◆ ZB_ZCL_STATUS_READ_ONLY

#define ZB_ZCL_STATUS_READ_ONLY   0x88U

Read only

◆ ZB_ZCL_STATUS_REQUIRE_MORE_IMAGE

#define ZB_ZCL_STATUS_REQUIRE_MORE_IMAGE   0x99U

The client still requires more OTA upgrade image files in order to successfully upgrade.

◆ ZB_ZCL_STATUS_SUCCESS

#define ZB_ZCL_STATUS_SUCCESS   0x00U

ZCL Success

◆ ZB_ZCL_STATUS_SW_FAIL

#define ZB_ZCL_STATUS_SW_FAIL   0xc1U

Software failure

◆ ZB_ZCL_STATUS_TIMEOUT

#define ZB_ZCL_STATUS_TIMEOUT   0x94U

Timeout

◆ ZB_ZCL_STATUS_UNREPORTABLE_ATTRIB

#define ZB_ZCL_STATUS_UNREPORTABLE_ATTRIB   0x8cU

Unreportable attribute

◆ ZB_ZCL_STATUS_UNSUP_ATTRIB

#define ZB_ZCL_STATUS_UNSUP_ATTRIB   0x86U

Unsupported attribute

◆ ZB_ZCL_STATUS_UNSUP_CLUST

#define ZB_ZCL_STATUS_UNSUP_CLUST   0xc3U

Cluster is not found on the target endpoint

◆ ZB_ZCL_STATUS_UNSUP_CLUST_CMD

#define ZB_ZCL_STATUS_UNSUP_CLUST_CMD   0x81U

Unsupported cluster command

◆ ZB_ZCL_STATUS_UNSUP_GEN_CMD

#define ZB_ZCL_STATUS_UNSUP_GEN_CMD   0x82U

Unsupported general command

◆ ZB_ZCL_STATUS_UNSUP_MANUF_CLUST_CMD

#define ZB_ZCL_STATUS_UNSUP_MANUF_CLUST_CMD   0x83U

Unsupported manuf-specific clust command

◆ ZB_ZCL_STATUS_UNSUP_MANUF_GEN_CMD

#define ZB_ZCL_STATUS_UNSUP_MANUF_GEN_CMD   0x84U

Unsupported manuf-specific general command

◆ ZB_ZCL_STATUS_WAIT_FOR_DATA

#define ZB_ZCL_STATUS_WAIT_FOR_DATA   0x97U

Server does not have data block available yet No OTA upgrade image available for a particular client.

◆ ZB_ZCL_STATUS_WRITE_ONLY

#define ZB_ZCL_STATUS_WRITE_ONLY   0x8fU

Write only

Typedef Documentation

◆ zb_zcl_cluster_check_value_t

typedef zb_ret_t(* zb_zcl_cluster_check_value_t) (zb_uint16_t attr_id, zb_uint8_t endpoint, zb_uint8_t *value)

ZCL Cluster Check Value Handler. This handler is called before attribute change (for corresponding cluster) and checks if new value is in correct range and can be applied.

Parameters
attr_id- ZCL Attribute ID
endpoint- Device Endpoint
value- pointer to the new Attribute Value
Returns
RET_OK if check is passed successfully (attribute can be changed), RET_OUT_OF_RANGE if the value is out of range (TODO: describe), RET_ERROR otherwise

◆ zb_zcl_cluster_handler_t

typedef zb_bool_t(* zb_zcl_cluster_handler_t) (zb_uint8_t param)

ZCL Cluster Command Handler. This handler is called on incoming ZCL command for corresponding cluster.

Parameters
param- pointer to buffer with ZCL command
Returns
ZB_TRUE if command was handled (no additional actions are needed), ZB_FALSE otherwise

◆ zb_zcl_cluster_id_t

Type for cluster roles in message exchange.

Holds one of zcl_cluster_id. Kept for backward compatibility as zcl_cluster_id were declared previously as enum.

◆ zb_zcl_cluster_init_t

typedef void(* zb_zcl_cluster_init_t) (void)

ZCL Cluster Init Handler. This handler is called on registering device context (ZB_AF_REGISTER_DEVICE_CTX). Initialization of the cluster should include zb_zcl_add_cluster_handlers call, if any of the cluster handlers are implemented.

Cluster Init handler is bound to the cluster declaration via ZB_ZCL_CLUSTER_DESC macro. Every cluster should implement "<cluster_id>_<cluster_role>_INIT" macro, for example:

#define ZB_ZCL_CLUSTER_ID_ON_OFF_SERVER_ROLE_INIT zb_zcl_on_off_init_server
#define ZB_ZCL_CLUSTER_ID_ON_OFF_CLIENT_ROLE_INIT zb_zcl_on_off_init_client

If cluster does not have any initialization steps and does not need any cluster handlers, Cluster Init handler may be NULL, for example:

#define ZB_ZCL_CLUSTER_ID_OCCUPANCY_SENSING_SERVER_ROLE_INIT (zb_zcl_cluster_init_t)NULL
#define ZB_ZCL_CLUSTER_ID_OCCUPANCY_SENSING_CLIENT_ROLE_INIT (zb_zcl_cluster_init_t)NULL

◆ zb_zcl_cluster_write_attr_hook_t

typedef void(* zb_zcl_cluster_write_attr_hook_t) (zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint8_t *new_value)

ZCL Cluster Write Attribute Hook Handler. This handler is called before attribute change (if any cluster-specific action needs to be bound to attribute change, it can be placed in this handler).

Parameters
endpoint- Device Endpoint
attr_id- ZCL Attribute ID
value- pointer to the new Attribute Value

◆ zb_zcl_modify_attr_value_cb_t

typedef void(* zb_zcl_modify_attr_value_cb_t) (zb_uint8_t ep, zb_uint16_t cluster_id, zb_uint16_t attr_id, zb_uint8_t *value)

Informs application that some attribute value is being updated by Write attribute command.

Parameters
ep- endpoint number
cluster_id- cluster ID
attr_id- attribute ID of the attribute being updated
value- pointer to new data

◆ zb_zcl_status_t

Type for ZCL status values.

Holds one of zcl_status. Kept only for backward compatibility as zcl_status were declared previously as enum.

Enumeration Type Documentation

◆ zb_zcl_attribute_reporting_status_e

Attribute Reporting Status.

Enumerator
ZB_ZCL_AR_STATUS_PENDING 

Pending.

ZB_ZCL_AR_STATUS_COMPLETE 

Attribute Reporting Complete.

◆ zb_zcl_parse_status_e

Parse frame operation status.

Enumerator
ZB_ZCL_PARSE_STATUS_SUCCESS 

Frame parsed successfully.

ZB_ZCL_PARSE_STATUS_FAILURE 

Frame parse operation failed.

Function Documentation

◆ zb_zcl_add_cluster_handlers()

zb_ret_t zb_zcl_add_cluster_handlers ( zb_uint16_t  cluster_id,
zb_uint8_t  cluster_role,
zb_zcl_cluster_check_value_t  cluster_check_value,
zb_zcl_cluster_write_attr_hook_t  cluster_write_attr_hook,
zb_zcl_cluster_handler_t  cluster_handler 
)

Add ZCL cluster handlers for Cluster ID and Cluster Role.

Parameters
cluster_id- ZCL Cluster ID
cluster_role- ZCL Cluster Role, see zcl_cluster_role
cluster_check_value- "Check Value" handler, see zb_zcl_cluster_check_value_t; may be NULL if this handler is not needed
cluster_write_attr_hook- "Write Attr Hook" handler, see zb_zcl_cluster_write_attr_hook_t; may be NULL if this handler is not needed
cluster_handler- "Cluster Commands" handler, see zb_zcl_cluster_handler_t; may be NULL if this handler is not needed
Returns
RET_OK if ZCL handlers were installed
RET_ALREADY_EXISTS if ZCL handlers are already installed (for given Cluster ID and Role), new handlers will not be installed in that case
RET_EMPTY if ZCL handlers were not installed
ZB_ZCL_CLUSTER_CLIENT_ROLE
#define ZB_ZCL_CLUSTER_CLIENT_ROLE
Definition: zb_zcl_common.h:190
ZB_ZCL_CLUSTER_SERVER_ROLE
#define ZB_ZCL_CLUSTER_SERVER_ROLE
Definition: zb_zcl_common.h:188
ZB_ZCL_CLUSTER_ANY_ROLE
#define ZB_ZCL_CLUSTER_ANY_ROLE
Definition: zb_zcl_common.h:192