Developing with ZBOSS

Modules

 General attributes' description
 
 General frame description
 
 Fill ZCL packet low-level API
 

Data Structures

struct  zb_zcl_cluster_desc_s
 ZCL cluster description. More...
 

Macros

#define ZB_ZCL_HI_MAX_PAYLOAD_SIZE   66
 
#define ZB_ZCL_HI_WO_IEEE_MAX_PAYLOAD_SIZE   82
 
#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 enum zb_zcl_cluster_id_e zb_zcl_cluster_id_t
 ZCL cluster identifiers. 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 enum zb_zcl_status_e zb_zcl_status_t
 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_cluster_role_e { ZB_ZCL_CLUSTER_SERVER_ROLE = 0x01, ZB_ZCL_CLUSTER_CLIENT_ROLE = 0x02, ZB_ZCL_CLUSTER_ANY_ROLE = 0x03 }
 Cluster roles in message exchange. More...
 
enum  zb_zcl_cluster_id_e {
  ZB_ZCL_CLUSTER_ID_BASIC = 0x0000, ZB_ZCL_CLUSTER_ID_POWER_CONFIG = 0x0001, ZB_ZCL_CLUSTER_ID_DEVICE_TEMP_CONFIG = 0x0002, ZB_ZCL_CLUSTER_ID_IDENTIFY = 0x0003,
  ZB_ZCL_CLUSTER_ID_GROUPS = 0x0004, ZB_ZCL_CLUSTER_ID_SCENES = 0x0005, ZB_ZCL_CLUSTER_ID_ON_OFF = 0x0006, ZB_ZCL_CLUSTER_ID_ON_OFF_SWITCH_CONFIG = 0x0007,
  ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL = 0x0008, ZB_ZCL_CLUSTER_ID_ALARMS = 0x0009, ZB_ZCL_CLUSTER_ID_TIME = 0x000a, ZB_ZCL_CLUSTER_ID_RSSI_LOCATION = 0x000b,
  ZB_ZCL_CLUSTER_ID_ANALOG_INPUT = 0x000c, ZB_ZCL_CLUSTER_ID_ANALOG_OUTPUT = 0x000d, ZB_ZCL_CLUSTER_ID_ANALOG_VALUE = 0x000e, ZB_ZCL_CLUSTER_ID_BINARY_INPUT = 0x000f,
  ZB_ZCL_CLUSTER_ID_BINARY_OUTPUT = 0x0010, ZB_ZCL_CLUSTER_ID_BINARY_VALUE = 0x0011, ZB_ZCL_CLUSTER_ID_MULTI_INPUT = 0x0012, ZB_ZCL_CLUSTER_ID_MULTI_OUTPUT = 0x0013,
  ZB_ZCL_CLUSTER_ID_MULTI_VALUE = 0x0014, ZB_ZCL_CLUSTER_ID_COMMISSIONING = 0x0015, ZB_ZCL_CLUSTER_ID_OTA_UPGRADE = 0x0019, ZB_ZCL_CLUSTER_ID_POLL_CONTROL = 0x0020,
  ZB_ZCL_CLUSTER_ID_GREEN_POWER = 0x0021, ZB_ZCL_CLUSTER_ID_KEEP_ALIVE = 0x0025, ZB_ZCL_CLUSTER_ID_SHADE_CONFIG = 0x0100, ZB_ZCL_CLUSTER_ID_DOOR_LOCK = 0x0101,
  ZB_ZCL_CLUSTER_ID_WINDOW_COVERING = 0x0102, ZB_ZCL_CLUSTER_ID_PUMP_CONFIG_CONTROL = 0x200, ZB_ZCL_CLUSTER_ID_THERMOSTAT = 0x201, ZB_ZCL_CLUSTER_ID_FAN_CONTROL = 0x202,
  ZB_ZCL_CLUSTER_ID_DEHUMID_CONTROL = 0x203, ZB_ZCL_CLUSTER_ID_THERMOSTAT_UI_CONFIG = 0x204, ZB_ZCL_CLUSTER_ID_COLOR_CONTROL = 0x0300, ZB_ZCL_CLUSTER_ID_BALLAST_CONFIG = 0x0301,
  ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT = 0x0400, ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT = 0x0402, ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT = 0x0403, ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT = 0x0405,
  ZB_ZCL_CLUSTER_ID_OCCUPANCY_SENSING = 0x0406, ZB_ZCL_CLUSTER_ID_IAS_ZONE = 0x0500, ZB_ZCL_CLUSTER_ID_IAS_ACE = 0x0501, ZB_ZCL_CLUSTER_ID_IAS_WD = 0x0502,
  ZB_ZCL_CLUSTER_ID_PRICE = 0x0700, ZB_ZCL_CLUSTER_ID_DRLC = 0x0701, ZB_ZCL_CLUSTER_ID_METERING = 0x0702, ZB_ZCL_CLUSTER_ID_MESSAGING = 0x0703,
  ZB_ZCL_CLUSTER_ID_TUNNELING = 0x0704, ZB_ZCL_CLUSTER_ID_PREPAYMENT = 0x0705, ZB_ZCL_CLUSTER_ID_ENERGY_MANAGEMENT = 0x0706, ZB_ZCL_CLUSTER_ID_CALENDAR = 0x0707,
  ZB_ZCL_CLUSTER_ID_DEVICE_MANAGEMENT = 0x0708, ZB_ZCL_CLUSTER_ID_EVENTS = 0x0709, ZB_ZCL_CLUSTER_ID_MDU_PAIRING = 0x070A, ZB_ZCL_CLUSTER_ID_SUB_GHZ = 0x070B,
  ZB_ZCL_CLUSTER_ID_DAILY_SCHEDULE = 0x070D, ZB_ZCL_CLUSTER_ID_KEY_ESTABLISHMENT = 0x0800, ZB_ZCL_CLUSTER_ID_APPLIANCE_EVENTS_AND_ALERTS = 0x0b02, ZB_ZCL_CLUSTER_ID_ELECTRICAL_MEASUREMENT = 0x0b04,
  ZB_ZCL_CLUSTER_ID_DIAGNOSTICS = 0x0b05, ZB_ZCL_CLUSTER_ID_WWAH = 0xFC57, ZB_ZCL_CLUSTER_ID_TUNNEL = 0xfc00, ZB_ZCL_CLUSTER_ID_IR_BLASTER = 0xfc01,
  ZB_ZCL_CLUSTER_ID_CUSTOM_ATTR = 0xffee, ZB_ZCL_CLUSTER_ID_METER_IDENTIFICATION = 0x0B01
}
 ZCL cluster identifiers. More...
 
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...
 
enum  zb_zcl_status_e {
  ZB_ZCL_STATUS_SUCCESS = 0x00, ZB_ZCL_STATUS_FAIL = 0x01, ZB_ZCL_STATUS_NOT_AUTHORIZED = 0x7E, ZB_ZCL_STATUS_MALFORMED_CMD = 0x80,
  ZB_ZCL_STATUS_UNSUP_CLUST_CMD = 0x81, ZB_ZCL_STATUS_UNSUP_GEN_CMD = 0x82, ZB_ZCL_STATUS_UNSUP_MANUF_CLUST_CMD = 0x83, ZB_ZCL_STATUS_UNSUP_MANUF_GEN_CMD = 0x84,
  ZB_ZCL_STATUS_INVALID_FIELD = 0x85, ZB_ZCL_STATUS_UNSUP_ATTRIB = 0x86, ZB_ZCL_STATUS_INVALID_VALUE = 0x87, ZB_ZCL_STATUS_READ_ONLY = 0x88,
  ZB_ZCL_STATUS_INSUFF_SPACE = 0x89, ZB_ZCL_STATUS_DUPE_EXISTS = 0x8a, ZB_ZCL_STATUS_NOT_FOUND = 0x8b, ZB_ZCL_STATUS_UNREPORTABLE_ATTRIB = 0x8c,
  ZB_ZCL_STATUS_INVALID_TYPE = 0x8d, ZB_ZCL_STATUS_WRITE_ONLY = 0x8f, ZB_ZCL_STATUS_INCONSISTENT = 0x92, ZB_ZCL_STATUS_ACTION_DENIED = 0x93,
  ZB_ZCL_STATUS_TIMEOUT = 0x94, ZB_ZCL_STATUS_ABORT = 0x95, ZB_ZCL_STATUS_INVALID_IMAGE = 0x96, ZB_ZCL_STATUS_WAIT_FOR_DATA = 0x97,
  ZB_ZCL_STATUS_NO_IMAGE_AVAILABLE = 0x98, ZB_ZCL_STATUS_REQUIRE_MORE_IMAGE = 0x99, ZB_ZCL_STATUS_NOTIFICATION_PENDING = 0x9A, ZB_ZCL_STATUS_HW_FAIL = 0xc0,
  ZB_ZCL_STATUS_SW_FAIL = 0xc1, ZB_ZCL_STATUS_CALIB_ERR = 0xc2, ZB_ZCL_STATUS_UNSUP_CLUST = 0xc3, ZB_ZCL_STATUS_LIMIT_REACHED = 0xc4
}
 ZCL status values. 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...
 

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_HI_MAX_PAYLOAD_SIZE

#define ZB_ZCL_HI_MAX_PAYLOAD_SIZE   66

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   82

Maximal payload size without long address sending

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

ZCL cluster identifiers.

See also
ZCL spec, subclause 2.2.2.

◆ 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

ZCL status values.

See also
ZCL spec, subclause 2.5.3
Note
The enumeration does not contain statuses not used in ZB HA profile

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_cluster_id_e

ZCL cluster identifiers.

See also
ZCL spec, subclause 2.2.2.
Enumerator
ZB_ZCL_CLUSTER_ID_BASIC 

Basic cluster identifier.

ZB_ZCL_CLUSTER_ID_POWER_CONFIG 

Power configuration cluster identifier.

ZB_ZCL_CLUSTER_ID_DEVICE_TEMP_CONFIG 

Device temperature configuration cluster identifier.

ZB_ZCL_CLUSTER_ID_IDENTIFY 

Identify cluster identifier.

ZB_ZCL_CLUSTER_ID_GROUPS 

Groups cluster identifier.

ZB_ZCL_CLUSTER_ID_SCENES 

Scenes cluster identifier.

ZB_ZCL_CLUSTER_ID_ON_OFF 

On/Off cluster identifier.

ZB_ZCL_CLUSTER_ID_ON_OFF_SWITCH_CONFIG 

On/Off switch configuration cluster identifier.

ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL 

Level control cluster identifier.

ZB_ZCL_CLUSTER_ID_ALARMS 

Alarms cluster identifier.

ZB_ZCL_CLUSTER_ID_TIME 

Time cluster identifier.

ZB_ZCL_CLUSTER_ID_RSSI_LOCATION 

RSSI location cluster identifier.

ZB_ZCL_CLUSTER_ID_ANALOG_INPUT 

Analog input (basic) cluster identifier.

ZB_ZCL_CLUSTER_ID_ANALOG_OUTPUT 

Analog output (basic) cluster identifier.

ZB_ZCL_CLUSTER_ID_ANALOG_VALUE 

Analog value (basic) cluster identifier.

ZB_ZCL_CLUSTER_ID_BINARY_INPUT 

Binary input (basic) cluster identifier.

ZB_ZCL_CLUSTER_ID_BINARY_OUTPUT 

Binary output (basic) cluster identifier.

ZB_ZCL_CLUSTER_ID_BINARY_VALUE 

Binary value (basic) cluster identifier.

ZB_ZCL_CLUSTER_ID_MULTI_INPUT 

Multistate input (basic) cluster identifier.

ZB_ZCL_CLUSTER_ID_MULTI_OUTPUT 

Multistate output (basic) cluster identifier.

ZB_ZCL_CLUSTER_ID_MULTI_VALUE 

Multistate value (basic) cluster identifier.

ZB_ZCL_CLUSTER_ID_COMMISSIONING 

Commissioning cluster identifier.

ZB_ZCL_CLUSTER_ID_OTA_UPGRADE 

Over The Air cluster identifier.

ZB_ZCL_CLUSTER_ID_POLL_CONTROL 

Poll control cluster identifier.

ZB_ZCL_CLUSTER_ID_GREEN_POWER 

Green Power cluster identifier.

ZB_ZCL_CLUSTER_ID_KEEP_ALIVE 

Keep Alive cluster identifier.

ZB_ZCL_CLUSTER_ID_SHADE_CONFIG 

Shade configuration cluster identifier.

ZB_ZCL_CLUSTER_ID_DOOR_LOCK 

Door lock cluster identifier.

ZB_ZCL_CLUSTER_ID_WINDOW_COVERING 

Window covering cluster identifier.

ZB_ZCL_CLUSTER_ID_PUMP_CONFIG_CONTROL 

Pump configuration and control cluster identifier.

ZB_ZCL_CLUSTER_ID_THERMOSTAT 

Thermostat cluster identifier.

ZB_ZCL_CLUSTER_ID_FAN_CONTROL 

Fan control cluster identifier.

ZB_ZCL_CLUSTER_ID_DEHUMID_CONTROL 

Dehumidification control cluster identifier.

ZB_ZCL_CLUSTER_ID_THERMOSTAT_UI_CONFIG 

Thermostat user interface configuration cluster identifier.

ZB_ZCL_CLUSTER_ID_COLOR_CONTROL 

Color control cluster identifier.

ZB_ZCL_CLUSTER_ID_BALLAST_CONFIG 

Ballast configuration cluster identifier.

ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT 

Illuminance measurement

ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT 

Temperature measurement

ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT 

Pressure measurement

ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT 

Relative humidity measurement

ZB_ZCL_CLUSTER_ID_OCCUPANCY_SENSING 

Occupancy sensing

ZB_ZCL_CLUSTER_ID_IAS_ZONE 

IAS Zone cluster identifier

ZB_ZCL_CLUSTER_ID_IAS_ACE 

IAS ACE cluster identifier

ZB_ZCL_CLUSTER_ID_IAS_WD 

IAS WD cluster identifier

ZB_ZCL_CLUSTER_ID_PRICE 

Price cluster identifier.

ZB_ZCL_CLUSTER_ID_DRLC 

Demand-Response cluster identifier.

ZB_ZCL_CLUSTER_ID_METERING 

Metering cluster identifier.

ZB_ZCL_CLUSTER_ID_MESSAGING 

Messaging cluster identifier.

ZB_ZCL_CLUSTER_ID_TUNNELING 

Tunneling cluster identifier.

ZB_ZCL_CLUSTER_ID_PREPAYMENT 

Prepayment cluster identifier.

ZB_ZCL_CLUSTER_ID_ENERGY_MANAGEMENT 

Energy Management cluster identifier.

ZB_ZCL_CLUSTER_ID_CALENDAR 

Calendar cluster identifier.

ZB_ZCL_CLUSTER_ID_DEVICE_MANAGEMENT 

Device Management cluster identifier.

ZB_ZCL_CLUSTER_ID_EVENTS 

Events cluster identifier.

ZB_ZCL_CLUSTER_ID_MDU_PAIRING 

MDU Pairing cluster identifier.

ZB_ZCL_CLUSTER_ID_SUB_GHZ 

Sub-GHz cluster identifier.

ZB_ZCL_CLUSTER_ID_DAILY_SCHEDULE 

Daily Schedule cluster identifier.

ZB_ZCL_CLUSTER_ID_KEY_ESTABLISHMENT 

Key Establishment cluster identifier.

ZB_ZCL_CLUSTER_ID_APPLIANCE_EVENTS_AND_ALERTS 

Appliance events and alerts cluster identifier

ZB_ZCL_CLUSTER_ID_ELECTRICAL_MEASUREMENT 

Electrical Measurement cluster identifier.

ZB_ZCL_CLUSTER_ID_DIAGNOSTICS 

Home Automation Diagnostics

ZB_ZCL_CLUSTER_ID_WWAH 

Works with All Hubs cluster identifier

ZB_ZCL_CLUSTER_ID_TUNNEL 

Manufacturer specific Tunnel cluster

ZB_ZCL_CLUSTER_ID_IR_BLASTER 

Manufacturer specific IR Blaster cluster

ZB_ZCL_CLUSTER_ID_CUSTOM_ATTR 

Custom Attributes

ZB_ZCL_CLUSTER_ID_METER_IDENTIFICATION 

Meter Identification cluster identifier

◆ zb_zcl_cluster_role_e

Cluster roles in message exchange.

Enumerator
ZB_ZCL_CLUSTER_SERVER_ROLE 

Server cluster role

ZB_ZCL_CLUSTER_CLIENT_ROLE 

Client cluster role

ZB_ZCL_CLUSTER_ANY_ROLE 

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

◆ 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.

◆ zb_zcl_status_e

ZCL status values.

See also
ZCL spec, subclause 2.5.3
Note
The enumeration does not contain statuses not used in ZB HA profile
Enumerator
ZB_ZCL_STATUS_SUCCESS 

ZCL Success

ZB_ZCL_STATUS_FAIL 

ZCL Fail

ZB_ZCL_STATUS_NOT_AUTHORIZED 

Server is not authorized to upgrade the client

ZB_ZCL_STATUS_MALFORMED_CMD 

Malformed command

ZB_ZCL_STATUS_UNSUP_CLUST_CMD 

Unsupported cluster command

ZB_ZCL_STATUS_UNSUP_GEN_CMD 

Unsupported general command

ZB_ZCL_STATUS_UNSUP_MANUF_CLUST_CMD 

Unsupported manuf-specific clust command

ZB_ZCL_STATUS_UNSUP_MANUF_GEN_CMD 

Unsupported manuf-specific general command

ZB_ZCL_STATUS_INVALID_FIELD 

Invalid field

ZB_ZCL_STATUS_UNSUP_ATTRIB 

Unsupported attribute

ZB_ZCL_STATUS_INVALID_VALUE 

Invalid value

ZB_ZCL_STATUS_READ_ONLY 

Read only

ZB_ZCL_STATUS_INSUFF_SPACE 

Insufficient space

ZB_ZCL_STATUS_DUPE_EXISTS 

Duplicate exists

ZB_ZCL_STATUS_NOT_FOUND 

Not found

ZB_ZCL_STATUS_UNREPORTABLE_ATTRIB 

Unreportable attribute

ZB_ZCL_STATUS_INVALID_TYPE 

Invalid type

ZB_ZCL_STATUS_WRITE_ONLY 

Write only

ZB_ZCL_STATUS_INCONSISTENT 

Supplied values are inconsistent

ZB_ZCL_STATUS_ACTION_DENIED 

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

ZB_ZCL_STATUS_TIMEOUT 

Timeout

ZB_ZCL_STATUS_ABORT 

Abort

ZB_ZCL_STATUS_INVALID_IMAGE 

Invalid OTA upgrade image

ZB_ZCL_STATUS_WAIT_FOR_DATA 

Server does not have data block available yet

ZB_ZCL_STATUS_NO_IMAGE_AVAILABLE 

No OTA upgrade image available for a particular client.

ZB_ZCL_STATUS_REQUIRE_MORE_IMAGE 

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

ZB_ZCL_STATUS_NOTIFICATION_PENDING 

The command has been received and is being processed.

ZB_ZCL_STATUS_HW_FAIL 

Hardware failure

ZB_ZCL_STATUS_SW_FAIL 

Software failure

ZB_ZCL_STATUS_CALIB_ERR 

Calibration error

ZB_ZCL_STATUS_UNSUP_CLUST 

Cluster is not found on the target endpoint

ZB_ZCL_STATUS_LIMIT_REACHED 

Cluster is not found on the target endpoint

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 zb_zcl_cluster_role_e
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