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_MAX_PHY_PAYLOAD_SIZE 127U |
#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_REVISION_DEFAULT 1 |
ZCL global attribute: cluster revision returned by default. Used if the GLOBAL_CLUSTER_REVISION attribute is undefined for the cluster/role. | |
#define | ZB_ZCL_CLUSTER_REV_MIN ZB_ZCL_GLOBAL_CLUSTER_REVISION_DEFAULT |
ZCL pre-ZCL8 API default cluster revision (minimal Cluster revision) | |
#define | ZB_ZCL_PEER_CLUSTER_REV_UNKNOWN 0xFFFFu |
ZCL unknown peer Cluster revision value. | |
#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_GETSINGLE(value) (*((zb_single_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, zb_uint16_t manuf_code) |
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 enum zb_zcl_security_use_option_e | zb_zcl_security_use_option_t |
Security use option. | |
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... | |
enum | zb_zcl_security_use_option_e { ZB_ZCL_SU_DISABLED, ZB_ZCL_SU_ENABLED, ZB_ZCL_SU_AUTO } |
Security use option. | |
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 | |
#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 backward compatibility modes | |
ZCL backward compatibility modes, introduced for ZCL8: ZB_ZCL_LEGACY_MODE (default mode) - pre-ZCL8 API sends packets in pre-ZCL8 format as is, no conversion applied ZCL8 API transforms packets into format according to the revision set in Cluster revision attribute value ZB_ZCL_AUTO_MODE - both pre-ZCL8 API and ZCL8 API transforms packets into format according to revision set in Cluster revision attribute value ZB_ZCL_COMPATIBILITY_MODE - both pre-ZCL8 API and ZCL8 API transforms packets into format according to peer Cluster revision provided by the application if the peer Cluster revision is greater than Cluster revision attribute value, then the Cluster revision will be used if there is no peer Cluster revision, the packet format is converted to the lowest possible Cluster revision | |
#define | ZB_ZCL_LEGACY_MODE 0x00U |
#define | ZB_ZCL_AUTO_MODE 0x01U |
#define | ZB_ZCL_COMPATIBILITY_MODE 0x02U |
ZCL backward compatibility status modes | |
ZCL backward compatibility status modes, introduced for ZCL8: ZCL8 spec merges some statuses defined in previous ZCL specs into one LIMIT_REACHED, DUPLICATE_EXISTS, SUCCESS ==> SUCCESS INCONSISTENT_STARTUP_STATE, DEFINED_OUT_OF_BAND, ACTION_DENIED, HARDWARE_FAILURE, SOFTWARE_FAILURE ==> FAILURE WRITE_ONLY, NOT_AUTHORIZED ==> NOT_AUTHORIZED MALFORMED_COMMAND, INVALID_FIELD ==> INVALID_FIELD UNSUP_CLUSTER_COMMAND, UNSUP_GENERAL_COMMAND, UNSUP_MANUF_CLUSTER_COMMAND, UNSUP_MANUF_GENERAL_COMMAND ==> UNSUP_COMMAND INCONSISTENT, CALIBRATION_ERROR, RESERVED ==> RESERVED There is no well-defined mechanism how to define which version of ZCL is used by the peer. It looks like the optimal solution is to send statuses according to ZCL6 and ZCL7 specifications. In that case there will be no miscommunication with legacy devices. Other ZCL8 devices should process obsolete statuses correctly because of backward compatibility required by ZCL8 spec. If application requires send statuses defined strictly according to ZCL8 spec, the device can be switch to this mode (and vice versa) in runtime to ZCL8 statuses mode via zb_zcl_set_backward_compatible_statuses_mode API function ZB_ZCL_STATUSES_PRE_ZCL8_MODE (default mode) - statuses will be send according to pre ZCL8 specifications ZB_ZCL_STATUSES_ZCL8_MODE - statuses will be send according to ZCL8 specification | |
#define | ZB_ZCL_STATUSES_PRE_ZCL8_MODE 0x00U |
#define | ZB_ZCL_STATUSES_ZCL8_MODE 0x01U |
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).
#define ZB_MAX_PHY_PAYLOAD_SIZE 127U |
ZCL payload maximum size; is used to calculate number of available bytes in variable-size commands
#define ZB_ZCL_AUTO_MODE 0x01U |
ZBOSS ZCL auto mode
#define ZB_ZCL_CLUSTER_ANY_ROLE 0x03U |
Internal value - used for searching any role (on the moment when cluster role is not known yet).
#define ZB_ZCL_CLUSTER_CLIENT_ROLE 0x02U |
Client cluster role
#define ZB_ZCL_CLUSTER_ID_ALARMS 0x0009U |
Alarms cluster identifier.
#define ZB_ZCL_CLUSTER_ID_ANALOG_INPUT 0x000cU |
Analog input (basic) cluster identifier.
#define ZB_ZCL_CLUSTER_ID_ANALOG_OUTPUT 0x000dU |
Analog output (basic) cluster identifier.
#define ZB_ZCL_CLUSTER_ID_ANALOG_VALUE 0x000eU |
Analog value (basic) cluster identifier.
#define ZB_ZCL_CLUSTER_ID_APPLIANCE_EVENTS_AND_ALERTS 0x0b02U |
Appliance events and alerts cluster identifier
#define ZB_ZCL_CLUSTER_ID_BALLAST_CONFIG 0x0301U |
Ballast configuration cluster identifier.
#define ZB_ZCL_CLUSTER_ID_BASIC 0x0000U |
Basic cluster identifier.
#define ZB_ZCL_CLUSTER_ID_BINARY_INPUT 0x000fU |
Binary input (basic) cluster identifier.
#define ZB_ZCL_CLUSTER_ID_BINARY_OUTPUT 0x0010U |
Binary output (basic) cluster identifier.
#define ZB_ZCL_CLUSTER_ID_BINARY_VALUE 0x0011U |
Binary value (basic) cluster identifier.
#define ZB_ZCL_CLUSTER_ID_CALENDAR 0x0707U |
Calendar cluster identifier.
#define ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT 0x040DU |
Carbon Dioxide (CO2) measurement
#define ZB_ZCL_CLUSTER_ID_COLOR_CONTROL 0x0300U |
Color control cluster identifier.
#define ZB_ZCL_CLUSTER_ID_COMMISSIONING 0x0015U |
Commissioning cluster identifier.
#define ZB_ZCL_CLUSTER_ID_CUSTOM_ATTR 0xffeeU |
Custom Attributes
#define ZB_ZCL_CLUSTER_ID_DAILY_SCHEDULE 0x070DU |
Daily Schedule cluster identifier.
#define ZB_ZCL_CLUSTER_ID_DEHUMID_CONTROL 0x203U |
Dehumidification control cluster identifier.
#define ZB_ZCL_CLUSTER_ID_DEVICE_MANAGEMENT 0x0708U |
Device Management cluster identifier.
#define ZB_ZCL_CLUSTER_ID_DEVICE_TEMP_CONFIG 0x0002U |
Device temperature configuration cluster identifier.
#define ZB_ZCL_CLUSTER_ID_DIAGNOSTICS 0x0b05U |
Home Automation Diagnostics
#define ZB_ZCL_CLUSTER_ID_DIRECT_CONFIGURATION 0x003DU |
Zigbee Direct Configuration cluster identifier
#define ZB_ZCL_CLUSTER_ID_DOOR_LOCK 0x0101U |
Door lock cluster identifier.
#define ZB_ZCL_CLUSTER_ID_DRLC 0x0701U |
Demand-Response cluster identifier.
#define ZB_ZCL_CLUSTER_ID_ELECTRICAL_MEASUREMENT 0x0b04U |
Electrical Measurement cluster identifier.
#define ZB_ZCL_CLUSTER_ID_ENERGY_MANAGEMENT 0x0706U |
Energy Management cluster identifier.
#define ZB_ZCL_CLUSTER_ID_EVENTS 0x0709U |
Events cluster identifier.
#define ZB_ZCL_CLUSTER_ID_FAN_CONTROL 0x202U |
Fan control cluster identifier.
#define ZB_ZCL_CLUSTER_ID_GREEN_POWER 0x0021U |
Green Power cluster identifier.
#define ZB_ZCL_CLUSTER_ID_GROUPS 0x0004U |
Groups cluster identifier.
#define ZB_ZCL_CLUSTER_ID_IAS_ACE 0x0501U |
IAS ACE cluster identifier
#define ZB_ZCL_CLUSTER_ID_IAS_WD 0x0502U |
IAS WD cluster identifier
#define ZB_ZCL_CLUSTER_ID_IAS_ZONE 0x0500U |
IAS Zone cluster identifier
#define ZB_ZCL_CLUSTER_ID_IDENTIFY 0x0003U |
Identify cluster identifier.
#define ZB_ZCL_CLUSTER_ID_ILLUMINANCE_MEASUREMENT 0x0400U |
Illuminance measurement
#define ZB_ZCL_CLUSTER_ID_IR_BLASTER 0xfc01U |
Manufacturer specific IR Blaster cluster
#define ZB_ZCL_CLUSTER_ID_KEEP_ALIVE 0x0025U |
Keep Alive cluster identifier.
#define ZB_ZCL_CLUSTER_ID_KEY_ESTABLISHMENT 0x0800U |
Key Establishment cluster identifier.
#define ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL 0x0008U |
Level control cluster identifier.
#define ZB_ZCL_CLUSTER_ID_MDU_PAIRING 0x070AU |
MDU Pairing cluster identifier.
#define ZB_ZCL_CLUSTER_ID_MESSAGING 0x0703U |
Messaging cluster identifier.
#define ZB_ZCL_CLUSTER_ID_METER_IDENTIFICATION 0x0B01U |
Meter Identification cluster identifier
#define ZB_ZCL_CLUSTER_ID_METERING 0x0702U |
Metering cluster identifier.
#define ZB_ZCL_CLUSTER_ID_MULTI_INPUT 0x0012U |
Multistate input (basic) cluster identifier.
#define ZB_ZCL_CLUSTER_ID_MULTI_OUTPUT 0x0013U |
Multistate output (basic) cluster identifier.
#define ZB_ZCL_CLUSTER_ID_MULTI_VALUE 0x0014U |
Multistate value (basic) cluster identifier.
#define ZB_ZCL_CLUSTER_ID_OCCUPANCY_SENSING 0x0406U |
Occupancy sensing
#define ZB_ZCL_CLUSTER_ID_ON_OFF 0x0006U |
On/Off cluster identifier.
#define ZB_ZCL_CLUSTER_ID_ON_OFF_SWITCH_CONFIG 0x0007U |
On/Off switch configuration cluster identifier.
#define ZB_ZCL_CLUSTER_ID_OTA_UPGRADE 0x0019U |
Over The Air cluster identifier.
#define ZB_ZCL_CLUSTER_ID_PM2_5_MEASUREMENT 0x042AU |
PM2.5 measurement
#define ZB_ZCL_CLUSTER_ID_POLL_CONTROL 0x0020U |
Poll control cluster identifier.
#define ZB_ZCL_CLUSTER_ID_POWER_CONFIG 0x0001U |
Power configuration cluster identifier.
#define ZB_ZCL_CLUSTER_ID_PREPAYMENT 0x0705U |
Prepayment cluster identifier.
#define ZB_ZCL_CLUSTER_ID_PRESSURE_MEASUREMENT 0x0403U |
Pressure measurement
#define ZB_ZCL_CLUSTER_ID_PRICE 0x0700U |
Price cluster identifier.
#define ZB_ZCL_CLUSTER_ID_PUMP_CONFIG_CONTROL 0x200U |
Pump configuration and control cluster identifier.
#define ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT 0x0405U |
Relative humidity measurement
#define ZB_ZCL_CLUSTER_ID_RSSI_LOCATION 0x000bU |
RSSI location cluster identifier.
#define ZB_ZCL_CLUSTER_ID_SCENES 0x0005U |
Scenes cluster identifier.
#define ZB_ZCL_CLUSTER_ID_SHADE_CONFIG 0x0100U |
Shade configuration cluster identifier.
#define ZB_ZCL_CLUSTER_ID_SUB_GHZ 0x070BU |
Sub-GHz cluster identifier.
#define ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT 0x0402U |
Temperature measurement
#define ZB_ZCL_CLUSTER_ID_THERMOSTAT 0x201U |
Thermostat cluster identifier.
#define ZB_ZCL_CLUSTER_ID_THERMOSTAT_UI_CONFIG 0x204U |
Thermostat user interface configuration cluster identifier.
#define ZB_ZCL_CLUSTER_ID_TIME 0x000aU |
Time cluster identifier.
#define ZB_ZCL_CLUSTER_ID_TUNNEL 0xfc00U |
Manufacturer specific Tunnel cluster
#define ZB_ZCL_CLUSTER_ID_TUNNELING 0x0704U |
Tunneling cluster identifier.
#define ZB_ZCL_CLUSTER_ID_WINDOW_COVERING 0x0102U |
Window covering cluster identifier.
#define ZB_ZCL_CLUSTER_ID_WWAH 0xFC57U |
Works with All Hubs cluster identifier
#define ZB_ZCL_CLUSTER_SERVER_ROLE 0x01U |
Server cluster role
#define ZB_ZCL_COMPATIBILITY_MODE 0x02U |
ZBOSS ZCL compatibility mode
#define ZB_ZCL_HI_MAX_PAYLOAD_SIZE 66U |
Maximal payload size
#define ZB_ZCL_HI_WO_IEEE_MAX_PAYLOAD_SIZE 82U |
Maximal payload size without long address sending
#define ZB_ZCL_LEGACY_MODE 0x00U |
ZBOSS ZCL legacy mode
#define ZB_ZCL_REVERT_CLUSTER_ROLE | ( | _d | ) |
Reverts cluster role
#define ZB_ZCL_STATUS_ABORT 0x95U |
Abort
#define ZB_ZCL_STATUS_ACTION_DENIED 0x93U |
ZCL7: The credentials presented by the device sending the command are not sufficient to perform this action. ZCL8: use FAILURE
#define ZB_ZCL_STATUS_CALIB_ERR 0xc2U |
ZCL7: Calibration error, ZCL8: reserved, CCB 2477 Status Code Cleanup: never used
#define ZB_ZCL_STATUS_DEFINED_OUT_OF_BAND 0x91U |
ZCL7: Out-of-band method to write an attribute, ZCL8: FAILURE, CCB 2477 Status Code Cleanup: never used
#define ZB_ZCL_STATUS_DUPE_EXISTS 0x8aU |
ZCL7: Duplicate exists, ZCL8: use SUCCESS
#define ZB_ZCL_STATUS_FAIL 0x01U |
ZCL Fail
#define ZB_ZCL_STATUS_HW_FAIL 0xc0U |
ZCL7: Hardware failure, ZCL8: use FAILURE
#define ZB_ZCL_STATUS_INCONSISTENT 0x92U |
ZCL7: Supplied values are inconsistent, ZCL8: reserved, CCB 2477 Status Code Cleanup: never used
#define ZB_ZCL_STATUS_INCONSISTENT_STARTUP_STATE 0x90U |
ZCL7: The value can put the device in an inconsistent state on startup, ZCL8: FAILURE, CCB 2477 Status Code Cleanup: never used
#define ZB_ZCL_STATUS_INSUFF_SPACE 0x89U |
Insufficient space
#define ZB_ZCL_STATUS_INVALID_FIELD 0x85U |
Invalid field
#define ZB_ZCL_STATUS_INVALID_IMAGE 0x96U |
Invalid OTA upgrade image
#define ZB_ZCL_STATUS_INVALID_TYPE 0x8dU |
Invalid type
#define ZB_ZCL_STATUS_INVALID_VALUE 0x87U |
Invalid value
#define ZB_ZCL_STATUS_LIMIT_REACHED 0xc4U |
ZCL7: Cluster is not found on the target endpoint, ZCL8: use SUCCESS
#define ZB_ZCL_STATUS_MALFORMED_CMD 0x80U |
Malformed command
#define ZB_ZCL_STATUS_NOT_AUTHORIZED 0x7EU |
The sender of the command does not have authorization to carry out this command.
#define ZB_ZCL_STATUS_NOT_FOUND 0x8bU |
Not found
#define ZB_ZCL_STATUS_NOTIFICATION_PENDING 0x9AU |
The command has been received and is being processed.
#define ZB_ZCL_STATUS_READ_ONLY 0x88U |
Read only
#define ZB_ZCL_STATUS_REQUIRE_MORE_IMAGE 0x99U |
The client still requires more OTA upgrade image files in order to successfully upgrade.
#define ZB_ZCL_STATUS_RESERVED 0x7FU |
CCB 2318 a reserved field may be used in the future and then be non-zero.
#define ZB_ZCL_STATUS_SUCCESS 0x00U |
ZCL Success
#define ZB_ZCL_STATUS_SW_FAIL 0xc1U |
ZCL7: Software failure, ZCL8: use FAILURE
#define ZB_ZCL_STATUS_TIMEOUT 0x94U |
Timeout
#define ZB_ZCL_STATUS_UNREPORTABLE_ATTRIB 0x8cU |
Unreportable attribute
#define ZB_ZCL_STATUS_UNSUP_ATTRIB 0x86U |
Unsupported attribute
#define ZB_ZCL_STATUS_UNSUP_CLUST 0xc3U |
Cluster is not found on the target endpoint
#define ZB_ZCL_STATUS_UNSUP_CLUST_CMD 0x81U |
ZCL7: Unsupported cluster command, ZCL8: use UNSUP_COMMAND
#define ZB_ZCL_STATUS_UNSUP_CMD 0x81U |
ZCL8: Unsupported command
#define ZB_ZCL_STATUS_UNSUP_GEN_CMD 0x82U |
ZCL7: Unsupported general command, ZCL8: use UNSUP_COMMAND
#define ZB_ZCL_STATUS_UNSUP_MANUF_CLUST_CMD 0x83U |
ZCL7: Unsupported manuf-specific clust command, ZCL8: use UNSUP_COMMAND
#define ZB_ZCL_STATUS_UNSUP_MANUF_GEN_CMD 0x84U |
ZCL7: Unsupported manuf-specific general command, ZCL8: use UNSUP_COMMAND
#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.
#define ZB_ZCL_STATUS_WRITE_ONLY 0x8fU |
ZCL7: Write only, ZCL8: use NOT_AUTHORIZED
#define ZB_ZCL_STATUSES_PRE_ZCL8_MODE 0x00U |
ZBOSS ZCL statuses Pre ZCL8 mode
#define ZB_ZCL_STATUSES_ZCL8_MODE 0x01U |
ZBOSS ZCL statuses ZCL8 mode
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.
attr_id | - ZCL Attribute ID |
endpoint | - Device Endpoint |
value | - pointer to the new Attribute Value |
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.
param | - pointer to buffer with ZCL command |
typedef zb_uint16_t 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.
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:
If cluster does not have any initialization steps and does not need any cluster handlers, Cluster Init handler may be NULL, for example:
typedef void(* zb_zcl_cluster_write_attr_hook_t) (zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint8_t *new_value, zb_uint16_t manuf_code) |
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).
endpoint | - Device Endpoint |
attr_id | - ZCL Attribute ID |
new_value | - pointer to the new Attribute Value |
manuf_code | - manufacturer specific code |
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.
ep | - endpoint number |
cluster_id | - cluster ID |
attr_id | - attribute ID of the attribute being updated |
value | - pointer to new data |
typedef zb_uint8_t 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.
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.
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 |