Logo
Developing with ZBOSS for Zigbee
zb_zcl_common.h File Reference
#include <zboss_api_core.h>

Data Structures

struct  zb_zcl_cluster_desc_s
 ZCL cluster description. More...
 
struct  zb_zcl_attr_s
 ZCL attribute definition structure. More...
 
struct  zb_zcl_frame_ctrl_s
 ZCL frame control field. More...
 
struct  zb_zcl_frame_hdr_full_s
 ZCL frame header with manufacturer code. More...
 
struct  zb_zcl_frame_hdr_short_s
 ZCL frame header without manufacturer code. More...
 
struct  zb_zcl_addr_s
 Type to represent source address of ZCL message. More...
 
union  zb_zcl_addr_s::zb_zcl_addr_u
 
struct  zb_zcl_parsed_hdr_s
 
struct  zb_zcl_attr_addr_info_s
 
struct  zb_zcl_command_send_status_s
 

Macros

#define ZB_COMPILE_ZCL_SAMPLE
 
#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. More...
 
#define ZB_ZCL_MANUF_CODE_INVALID   0x0000
 Internal invalid manufacturer code value. More...
 
#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. More...
 
#define ZB_ZCL_CLUSTER_REV_MIN   ZB_ZCL_GLOBAL_CLUSTER_REVISION_DEFAULT
 ZCL pre-ZCL8 API default cluster revision (minimal Cluster revision) More...
 
#define ZB_ZCL_PEER_CLUSTER_REV_UNKNOWN   0xFFFFu
 ZCL unknown peer Cluster revision value. More...
 
#define ZB_ZCL_SET_STRING_VAL(str, val, len)   (ZB_MEMCPY((zb_uint8_t*)(str) + 1, (val), (len)), *(zb_uint8_t*)(str) = (len))
 Sets correctly ZCL char string value. More...
 
#define ZB_ZCL_GET_STRING_LENGTH(str)   ((str)[0])
 Get ZCL string length. More...
 
#define ZB_ZCL_SET_STRING_LENGTH(str, _newlen)   (((str))[0] = (_newlen))
 
#define ZB_ZCL_STRING_CONST_SIZE(str)   (zb_uint8_t)(sizeof(str) - 1)
 Returns size of a string constant. More...
 
#define ZB_ZCL_GET_STRING_BEGIN(_str)   (&((_str)[1]))
 
#define ZB_ZCL_GET_STRING_END(_str)   (ZB_ZCL_GET_STRING_BEGIN(_str) + ZB_ZCL_GET_STRING_LENGTH(_str))
 
#define ZB_ZCL_GET_STRING_REF_AT(_str, _pos)   (ZB_ZCL_GET_STRING_BEGIN(_str) + _pos)
 
#define ZB_ZCL_GET_STRING_CHAR_AT(_str, _pos)   *ZB_ZCL_GET_STRING_REF_AT(_str, _pos)
 
#define ZB_ZCL_STRING_TO_C_STRING(_str)
 
#define ZB_ZCL_STRING_CLEAR(_str)   (_str[0] = 0)
 
#define ZB_ZCL_STRING_APPEND_C_STR(_zcl_str, _zcl_str_max_size, _c_str)   zb_zcl_string_append_data(_zcl_str, _zcl_str_max_size, (const zb_uint8_t *) _c_str, strlen(_c_str))
 
#define ZB_ZCL_STATIC_STRING_APPEND_C_STR(_zcl_s_str, _c_str)   ZB_ZCL_STRING_APPEND_C_STR((zb_uint8_t *) _zcl_s_str, sizeof(_zcl_s_str), _c_str)
 
#define ZB_ZCL_STATIC_STRING_APPEND_CHAR(_zcl_s_str, _char)   zb_zcl_string_append_byte(_zcl_s_str, sizeof(_zcl_s_str), (zb_uint8_t) _char)
 
#define ZB_ZCL_ATTR_SET_WITH_ATTR_ID(_set, _id)   ((_set << 8) | (_id & 0xFF))
 
#define ZB_ZCL_CLUSTER_REVISION_DEFAULT   1
 ZCL 6.0: Default value for cluster revision global attribute, see zcl_attr_global. More...
 
#define ZB_ZCL_SET_ATTRIBUTE(ep, cluster_id, cluster_role, attr_id, value_ptr, check_access)
 Sets attribute value, perform all needed checks before and after setting new value, including read-only check and marking for reporting. More...
 
#define ZB_ZCL_SET_DIRECTLY_ATTR_VAL8(attr_desc, value)
 Set attribute 8-bit value without any check. Use this macro on your own risk, if and only if you are absolutely sure that no check for Access rights, Reporting and attribute type is needed. More...
 
#define ZB_ZCL_SET_DIRECTLY_ATTR_VAL16(attr_desc, value)
 Set attribute 16-bit value without any check. Use this macro on your own risk, if and only if you are absolutely sure that no check for Access rights, Reporting and attribute type is needed. More...
 
#define ZB_ZCL_SET_DIRECTLY_ATTR_VAL32(attr_desc, value)
 Set attribute 32-bit value without any check. Use this macro on your own risk, if and only if you are absolutely sure that no check for Access rights, Reporting and attribute type is needed. More...
 
#define ZB_ZCL_GET_ATTRIBUTE_VAL_8(attr_desc)   (*(zb_uint8_t*)attr_desc->data_p)
 
#define ZB_ZCL_GET_ATTRIBUTE_VAL_S8(attr_desc)   (*(zb_int8_t*)attr_desc->data_p)
 
#define ZB_ZCL_GET_ATTRIBUTE_VAL_16(attr_desc)   (*(zb_uint16_t*)attr_desc->data_p)
 
#define ZB_ZCL_GET_ATTRIBUTE_VAL_S16(attr_desc)   (*(zb_int16_t*)attr_desc->data_p)
 
#define ZB_ZCL_GET_ATTRIBUTE_VAL_32(attr_desc)   (*(zb_uint32_t*)attr_desc->data_p)
 
#define ZB_ZCL_GET_ATTRIBUTE_VAL_S32(attr_desc)   (*(zb_int32_t*)attr_desc->data_p)
 
#define ZB_ZCL_GET_ATTRIBUTE_VAL_SINGLE(attr_desc)   (*(zb_single_t*)attr_desc->data_p)
 
#define ZB_ZCL_MANUFACTURER_WILDCARD_ID   0xFFFFU
 
#define ZB_ZCL_NON_MANUFACTURER_SPECIFIC   0xFFFFU
 
#define ZB_ZCL_REVERT_DIRECTION(_d)   (((_d) == ZB_ZCL_FRAME_DIRECTION_TO_SRV) ? ZB_ZCL_FRAME_DIRECTION_TO_CLI : ZB_ZCL_FRAME_DIRECTION_TO_SRV)
 Reverts ZCL direction value. More...
 
#define ZB_ZCL_PARSED_HDR_SHORT_DATA(header)   ((header)->addr_data.common_data)
 Extract common addressing data from parsed ZCL structure. More...
 
#define ZB_ZCL_GET_FRAME_TYPE(v)
 Get ZCL frame type zcl_frame_type. More...
 
#define ZB_ZCL_GET_MANUF_SPECIFIC(v)
 Check is ZCL frame manufacturer specific zcl_manufacturer_specific. More...
 
#define ZB_ZCL_IS_MANUF_SPECIFIC(v)   (ZB_ZCL_GET_MANUF_SPECIFIC(v) != 0U)
 
#define ZB_ZCL_GET_DIRECTION(v)
 Get ZCL frame direction zcl_frame_direction. More...
 
#define ZB_ZCL_GET_DISABLE_DEFAULT_RESPONSE(v)
 Get ZCL disable default response field zcl_disable_default_response. More...
 
#define ZB_ZCL_SET_FRAME_TYPE(v, val)
 Set ZCL frame type zcl_frame_type. More...
 
#define ZB_ZCL_SET_MANUF_SPECIFIC(v, val)
 Set ZCL frame manufacturer specific zcl_manufacturer_specific. More...
 
#define ZB_ZCL_SET_DIRECTION(v, val)
 Set ZCL frame direction zcl_frame_direction. More...
 
#define ZB_ZCL_SET_DISABLE_DEFAULT_RESPONSE(v, val)
 Set ZCL disable default response field zcl_disable_default_response. More...
 
#define ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_RES_FRAME_CONTROL(buf_ptr)
 Construct ZCL header frame control value for cluster-specific command response. More...
 
#define ZB_ZCL_CONSTRUCT_COMMAND_HEADER(data_ptr, tsn, cmd_id)
 Construct ZCL header. More...
 
#define ZB_ZCL_CONSTRUCT_COMMAND_HEADER_EXT(_data_ptr, _tsn, _is_manuf_spec, _manuf_specific, _cmd_id)
 Construct ZCL header, Manufacturer specific value is conditionally supported. More...
 
#define ZB_ZCL_GET_SEQ_NUM()
 Return next sequence number for ZCL frame. More...
 
#define ZB_ZCL_COPY_PARSED_HEADER(buf, dst)
 Copy parsed ZCL header from buffer. More...
 
#define ZB_ZCL_SEND_CMD( buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, dis_default_resp, cluster_id, command_id, cb)
 General macro for sending a command with empty payload. More...
 
#define ZB_ZCL_START_PACKET(zbbuf)
 Initializes zb_buf_t buffer and returns pointer to the beginning of array. More...
 
#define ZB_ZCL_GET_BYTES_WRITTEN(zbbuf, ptr)
 Return number of bytes written to the buffer. More...
 
#define ZB_ZCL_GET_BYTES_AVAILABLE_WITH_FRAGMENTATION(zbbuf, ptr)
 
#define ZB_ZCL_GET_BYTES_AVAILABLE_WO_FRAGMENTATION(zbbuf, ptr)   (ZB_ZCL_HI_WO_IEEE_MAX_PAYLOAD_SIZE - ZB_ZCL_GET_BYTES_WRITTEN(zbbuf, ptr))
 
#define ZB_ZCL_GET_BYTES_AVAILABLE(zbbuf, ptr, profile_id, cluster_id)
 Return number of bytes available in a packet. More...
 
#define ZB_ZCL_ATTR_SZ_RAW(attr_size)
 
#define ZB_ZCL_PACKET_PUT_DATA8(ptr, val)
 Put 8-bit value to packet. More...
 
#define ZB_ZCL_PACKET_PUT_DATA16(ptr, val)
 
#define ZB_ZCL_PACKET_PUT_DATA16_VAL(ptr, val)   (ptr) = zb_put_next_htole16((ptr), val)
 
#define ZB_ZCL_PACKET_PUT_2DATA16_VAL(ptr, val1, val2)   (ptr) = zb_put_next_2_htole16((ptr),(val1),(val2))
 
#define ZB_ZCL_PACKET_PUT_2DATA32_VAL(ptr, val1, val2)   (ptr) = zb_put_next_2_htole32((ptr),(val1),(val2))
 
#define ZB_ZCL_PACKET_PUT_DATA32_VAL(ptr, val)
 Put 32-bit value to packet. More...
 
#define ZB_ZCL_PACKET_PUT_DATA32(ptr, val)
 Put 32-bit value to packet. More...
 
#define ZB_ZCL_PACKET_PUT_DATA48_VAL(ptr, val)
 Put 48-bit value to packet. More...
 
#define ZB_ZCL_PACKET_PUT_DATA48(ptr, val)
 Put 48-bit value to packet. More...
 
#define ZB_ZCL_PACKET_PUT_DATA24_VAL(ptr, val)
 Put 24-bit value to packet. More...
 
#define ZB_ZCL_PACKET_PUT_DATA24(ptr, val)
 Put 24-bit value to packet. More...
 
#define ZB_ZCL_PACKET_PUT_DATA64(ptr, val)
 Put 64-bit value to packet. More...
 
#define ZB_ZCL_PACKET_GET_DATA8(dst_ptr, src_ptr)
 Get 8-bit value from packet. More...
 
#define ZB_ZCL_PACKET_PUT_DATA_N(ptr, val, n)
 Put N byte data to packet. More...
 
#define ZB_ZCL_PACKET_GET_DATA16(dst_ptr, src_ptr)
 Get 16-bit value from packet. More...
 
#define ZB_ZCL_PACKET_GET_DATA24(dst_ptr, src_ptr)
 Get 24-bit value from packet. More...
 
#define ZB_ZCL_PACKET_GET_DATA48(dst_ptr, src_ptr)
 Get 48-bit value from packet. More...
 
#define ZB_ZCL_PACKET_GET_DATA32(dst_ptr, src_ptr)
 Get 32-bit value from packet. More...
 
#define ZB_ZCL_PACKET_GET_DATA64(dst_ptr, src_ptr)
 Get 64-bit value from packet. More...
 
#define ZB_ZCL_PACKET_GET_DATA_IEEE(dst_ptr, src_ptr)
 Get IEEE address from packet. More...
 
#define ZB_ZCL_PACKET_PUT_DATA_IEEE(dst_ptr, src_ptr)
 Put IEEE address into packet. More...
 
#define ZB_ZCL_PACKET_PUT_STRING(_ptr, _val)
 
#define ZB_ZCL_PACKET_GET_STRING(_zcl_str, data, _zcl_str_max_size)
 
#define ZB_ZCL_PACKET_GET_STATIC_STRING(_zcl_str, data)   ZB_ZCL_PACKET_GET_STRING(_zcl_str, data, sizeof(_zcl_str))
 
#define ZB_ZCL_PACKET_GET_DATA_N(dst_ptr, src_ptr, n)
 Get N-byte value from packet. More...
 
#define ZB_ZCL_FINISH_PACKET(zbbuf, ptr)   (void)zb_zcl_finish_and_send_packet((zbbuf), (ptr),
 
#define ZB_ZCL_SEND_COMMAND_SHORT(buffer, addr, dst_addr_mode, dst_ep, ep, prof_id, cluster_id, cb)   (const zb_addr_u *)(const void *)(&(addr)), (dst_addr_mode), (dst_ep), (ep), (prof_id), (cluster_id), (cb))
 
#define ZB_ZCL_FINISH_N_SEND_PACKET(zbbuf, ptr, addr, dst_addr_mode, dst_ep, ep, prof_id, cluster_id, cb)   (void) zb_zcl_finish_and_send_packet((zbbuf), (ptr),(const zb_addr_u *)(const void *)(&(addr)), dst_addr_mode, dst_ep, ep, prof_id, cluster_id, cb)
 
#define ZB_ZCL_FINISH_N_SEND_PACKET_NEW(zbbuf, ptr, addr, dst_addr_mode, dst_ep, ep, prof_id, cluster_id, cb, aps_secured, disable_aps_ack, delay)   (void) zb_zcl_finish_and_send_packet_new((zbbuf), (ptr),(const zb_addr_u *)(const void *)(&(addr)), dst_addr_mode, dst_ep, ep, prof_id, cluster_id, cb, aps_secured, disable_aps_ack, delay)
 
#define ZB_ZCL_FINISH_PACKET_O(zbbuf, ptr)   (ptr) = zb_buf_alloc_left((zbbuf), ZB_ZCL_GET_BYTES_WRITTEN((zbbuf), (ptr)));
 
#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))
 
#define ZB_ZCL_FIX_ENDIAN(data_ptr, data_type)
 Fix data endian, if needed, and store it in the same buffer. More...
 
#define ZB_ZCL_ATTRIB_LIST_GET_COUNT(list)   ZB_ARRAY_SIZE((list)) - 2
 
#define ZB_ZCL_ATTRIB_LIST_GET_PTR(list)   (zb_zcl_attr_t *)(list) + 1
 
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_CARBON_DIOXIDE_MEASUREMENT   0x040DU
 
#define ZB_ZCL_CLUSTER_ID_PM2_5_MEASUREMENT   0x042AU
 
#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_MSC_INITIAL_CLUSTER_ID   0xFC00U
 
#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
 
#define ZB_ZCL_CLUSTER_ID_DIRECT_CONFIGURATION   0x003DU
 
ZCL status values

See also
ZCL8 spec, subclause 2.6.3, Table 2-12
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_RESERVED   0x7FU
 
#define ZB_ZCL_STATUS_MALFORMED_CMD   0x80U
 
#define ZB_ZCL_STATUS_UNSUP_CMD   0x81U
 
#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_STARTUP_STATE   0x90U
 
#define ZB_ZCL_STATUS_DEFINED_OUT_OF_BAND   0x91U
 
#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
 
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
 
ZCL attribute data type values

Note
The enumeration is not full, and does not contain ZCL types not used in HA profile.
See also
ZCL spec., subclause 2.5.2, Table 2-10. Data Types
#define ZB_ZCL_ATTR_TYPE_NULL   0x00U
 
#define ZB_ZCL_ATTR_TYPE_8BIT   0x08U
 
#define ZB_ZCL_ATTR_TYPE_16BIT   0x09U
 
#define ZB_ZCL_ATTR_TYPE_24BIT   0x0aU
 
#define ZB_ZCL_ATTR_TYPE_32BIT   0x0bU
 
#define ZB_ZCL_ATTR_TYPE_40BIT   0x0cU
 
#define ZB_ZCL_ATTR_TYPE_48BIT   0x0dU
 
#define ZB_ZCL_ATTR_TYPE_56BIT   0x0eU
 
#define ZB_ZCL_ATTR_TYPE_64BIT   0x0fU
 
#define ZB_ZCL_ATTR_TYPE_BOOL   0x10U
 
#define ZB_ZCL_ATTR_TYPE_8BITMAP   0x18U
 
#define ZB_ZCL_ATTR_TYPE_16BITMAP   0x19U
 
#define ZB_ZCL_ATTR_TYPE_24BITMAP   0x1aU
 
#define ZB_ZCL_ATTR_TYPE_32BITMAP   0x1bU
 
#define ZB_ZCL_ATTR_TYPE_40BITMAP   0x1cU
 
#define ZB_ZCL_ATTR_TYPE_48BITMAP   0x1dU
 
#define ZB_ZCL_ATTR_TYPE_56BITMAP   0x1eU
 
#define ZB_ZCL_ATTR_TYPE_64BITMAP   0x1fU
 
#define ZB_ZCL_ATTR_TYPE_U8   0x20U
 
#define ZB_ZCL_ATTR_TYPE_U16   0x21U
 
#define ZB_ZCL_ATTR_TYPE_U24   0x22U
 
#define ZB_ZCL_ATTR_TYPE_U32   0x23U
 
#define ZB_ZCL_ATTR_TYPE_U40   0x24U
 
#define ZB_ZCL_ATTR_TYPE_U48   0x25U
 
#define ZB_ZCL_ATTR_TYPE_U56   0x26U
 
#define ZB_ZCL_ATTR_TYPE_U64   0x27U
 
#define ZB_ZCL_ATTR_TYPE_S8   0x28U
 
#define ZB_ZCL_ATTR_TYPE_S16   0x29U
 
#define ZB_ZCL_ATTR_TYPE_S24   0x2aU
 
#define ZB_ZCL_ATTR_TYPE_S32   0x2bU
 
#define ZB_ZCL_ATTR_TYPE_S40   0x2cU
 
#define ZB_ZCL_ATTR_TYPE_S48   0x2dU
 
#define ZB_ZCL_ATTR_TYPE_S56   0x2eU
 
#define ZB_ZCL_ATTR_TYPE_S64   0x2fU
 
#define ZB_ZCL_ATTR_TYPE_8BIT_ENUM   0x30U
 
#define ZB_ZCL_ATTR_TYPE_16BIT_ENUM   0x31U
 
#define ZB_ZCL_ATTR_TYPE_SEMI   0x38U
 
#define ZB_ZCL_ATTR_TYPE_SINGLE   0x39U
 
#define ZB_ZCL_ATTR_TYPE_DOUBLE   0x3aU
 
#define ZB_ZCL_ATTR_TYPE_OCTET_STRING   0x41U
 
#define ZB_ZCL_ATTR_TYPE_CHAR_STRING   0x42U
 
#define ZB_ZCL_ATTR_TYPE_LONG_OCTET_STRING   0x43U
 
#define ZB_ZCL_ATTR_TYPE_LONG_CHAR_STRING   0x44U
 
#define ZB_ZCL_ATTR_TYPE_ARRAY   0x48U
 
#define ZB_ZCL_ATTR_TYPE_STRUCTURE   0x4cU
 
#define ZB_ZCL_ATTR_TYPE_SET   0x50U
 
#define ZB_ZCL_ATTR_TYPE_BAG   0x51U
 
#define ZB_ZCL_ATTR_TYPE_TIME_OF_DAY   0xe0U
 
#define ZB_ZCL_ATTR_TYPE_DATE   0xe1U
 
#define ZB_ZCL_ATTR_TYPE_UTC_TIME   0xe2U
 
#define ZB_ZCL_ATTR_TYPE_CLUSTER_ID   0xe8U
 
#define ZB_ZCL_ATTR_TYPE_ATTRIBUTE_ID   0xe9U
 
#define ZB_ZCL_ATTR_TYPE_BACNET_OID   0xeaU
 
#define ZB_ZCL_ATTR_TYPE_IEEE_ADDR   0xf0U
 
#define ZB_ZCL_ATTR_TYPE_128_BIT_KEY   0xf1U
 
#define ZB_ZCL_ATTR_TYPE_CUSTOM_32ARRAY   0x4aU
 
#define ZB_ZCL_ATTR_TYPE_INVALID   0xffU
 
ZCL attribute access values

#define ZB_ZCL_ATTR_ACCESS_READ_ONLY   0x01U
 
#define ZB_ZCL_ATTR_ACCESS_WRITE_ONLY   0x02U
 
#define ZB_ZCL_ATTR_ACCESS_READ_WRITE   (ZB_ZCL_ATTR_ACCESS_READ_ONLY | ZB_ZCL_ATTR_ACCESS_WRITE_ONLY)
 
#define ZB_ZCL_ATTR_ACCESS_REPORTING   0x04U
 
#define ZB_ZCL_ATTR_ACCESS_SINGLETON   0x08U
 
#define ZB_ZCL_ATTR_ACCESS_SCENE   0x10U
 
#define ZB_ZCL_ATTR_MANUF_SPEC   0x20U
 
#define ZB_ZCL_ATTR_ACCESS_INTERNAL   0x40U
 
Global attributes that are included to each cluster

See also
ZCL spec - 6.0
#define ZB_ZCL_ATTR_GLOBAL_CLUSTER_REVISION_ID   0xfffdU
 
#define ZB_ZCL_ATTR_GLOBAL_ATTRIBUTE_REPORTING_STATUS_ID   0xfffeU
 
ZCL frame type

Defines Permitted values for Frame Type subfield of Frame Control field in ZCL frame.

#define ZB_ZCL_FRAME_TYPE_COMMON   0x00U
 
#define ZB_ZCL_FRAME_TYPE_CLUSTER_SPECIFIC   0x01U
 
Values for Manufacturer-specific subfield of FCF in ZCL frame

See also
ZCL spec, subclause 2.3.1.1.2
#define ZB_ZCL_NOT_MANUFACTURER_SPECIFIC   0x00U
 
#define ZB_ZCL_MANUFACTURER_SPECIFIC   0x01U
 
Disable default response subfield of FCF in ZCL frame

See also
ZCL spec, subclause 2.3.1.1.3
#define ZB_ZCL_ENABLE_DEFAULT_RESPONSE   0x00U
 
#define ZB_ZCL_DISABLE_DEFAULT_RESPONSE   0x01U
 
ZCL frame direction

See also
ZCL spec, subclause 2.3.1.1.3.
#define ZB_ZCL_FRAME_DIRECTION_TO_SRV   0x00U
 
#define ZB_ZCL_FRAME_DIRECTION_TO_CLI   0x01U
 
ZCL address type

Possible address types of devices from which ZCL message is received.

#define ZB_ZCL_ADDR_TYPE_SHORT   0U
 
#define ZB_ZCL_ADDR_TYPE_IEEE_GPD   1U
 
#define ZB_ZCL_ADDR_TYPE_SRC_ID_GPD   2U
 
#define ZB_ZCL_ADDR_TYPE_IEEE   3U
 
ZCL GPD address type

Macro helps to see whether addr_type belongs to GPD subgroup

#define ZB_ZCL_ADDR_TYPE_IS_GPD(_addr_type)
 

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. More...
 
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. More...
 
typedef enum zb_zcl_attribute_reporting_status_e zb_zcl_attribute_reporting_status_t
 Attribute Reporting Status. More...
 
typedef enum zb_zcl_security_use_option_e zb_zcl_security_use_option_t
 Security use option. More...
 
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...
 
typedef zb_uint8_t zb_zcl_attr_type_t
 Type for ZCL attribute data type values. More...
 
typedef zb_uint8_t zb_zcl_attr_access_t
 Type for possible values of ZCL attribute access values. More...
 
typedef struct zb_zcl_attr_s zb_zcl_attr_t
 ZCL attribute definition structure. More...
 
typedef zb_uint8_t zb_zcl_frame_type_t
 Type for ZCL frame type. More...
 
typedef zb_uint8_t zb_zcl_manufacturer_specific_t
 Type for return statuses of mathematical operations. More...
 
typedef zb_uint8_t zb_zcl_disable_default_response_t
 Type for possible values of Disable default response subfield of FCF in ZCL frame. More...
 
typedef zb_uint8_t zb_zcl_frame_direction_t
 Type for ZCL frame direction. More...
 
typedef struct zb_zcl_frame_ctrl_s zb_zcl_frame_ctrl_t
 ZCL frame control field. More...
 
typedef struct zb_zcl_frame_hdr_full_s zb_zcl_frame_hdr_full_t
 ZCL frame header with manufacturer code. More...
 
typedef struct zb_zcl_frame_hdr_short_s zb_zcl_frame_hdr_short_t
 ZCL frame header without manufacturer code. More...
 
typedef struct zb_zcl_addr_s zb_zcl_addr_t
 Type to represent source address of ZCL message. More...
 
typedef struct zb_zcl_parsed_hdr_s zb_zcl_parsed_hdr_t
 
typedef struct zb_zcl_attr_addr_info_s zb_zcl_attr_addr_info_t
 
typedef struct zb_zcl_command_send_status_s zb_zcl_command_send_status_t
 
typedef void(* zb_zcl_set_default_value_attr_cb_t) (zb_uint8_t ep)
 Set default value attribute callback. More...
 
typedef zb_ret_t(* zb_zcl_app_check_attr_value_cb_t) (zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint8_t *value)
 Check attribute value callback. More...
 
typedef zb_ret_t(* zb_zcl_app_check_attr_value_manuf_cb_t) (zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint16_t manuf_code, zb_uint8_t *value)
 Check attribute value callback with manufacturer specific code. More...
 
typedef zb_uint16_t(* zb_zcl_peer_revision_cb_t) (zb_ieee_addr_t ieee_addr, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint8_t endpoint)
 Get peer Cluster revision callback. 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. 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...
 
static ZB_INLINE zb_uint16_t zb_zcl_string_append_data (zb_uint8_t *zcl_str, zb_uint8_t zcl_str_max_size, const zb_uint8_t *c_str, zb_uint8_t c_str_len)
 
static ZB_INLINE zb_uint16_t zb_zcl_string_append_byte (zb_uint8_t *zcl_str, zb_uint8_t zcl_str_max_size, zb_uint8_t value)
 
void * zb_zcl_start_command_header (zb_bufid_t zbbuf, zb_uint8_t frame_ctl, zb_uint16_t manuf_code, zb_uint8_t cmd_id, zb_uint8_t *tsn)
 Construct ZCL command header in the buffer. More...
 
zb_bool_t zb_zcl_can_cluster_be_fragmented (zb_uint16_t profile_id, zb_uint16_t cluster_id)
 
zb_ret_t zb_zcl_finish_and_send_packet (zb_bufid_t buffer, zb_uint8_t *ptr, const zb_addr_u *dst_addr, zb_uint8_t dst_addr_mode, zb_uint8_t dst_ep, zb_uint8_t ep, zb_uint16_t prof_id, zb_uint16_t cluster_id, zb_callback_t cb)
 ZCL finish and send packet. More...
 
zb_ret_t zb_zcl_finish_and_send_packet_new (zb_bufid_t buffer, zb_uint8_t *ptr, const zb_addr_u *dst_addr, zb_uint8_t dst_addr_mode, zb_uint8_t dst_ep, zb_uint8_t ep, zb_uint16_t prof_id, zb_uint16_t cluster_id, zb_callback_t cb, zb_bool_t aps_secured, zb_bool_t disable_aps_ack, zb_uint16_t delay)
 
zb_ret_t zb_zcl_finish_and_send_packet_common (zb_bufid_t buffer, zb_uint8_t *ptr, zb_callback_t cb, zb_zcl_security_use_option_t security_option, zb_bool_t disable_aps_ack, zb_uint16_t delay)
 
zb_zcl_attr_tzb_zcl_get_attr_desc (zb_zcl_cluster_desc_t *cluster_desc, zb_uint16_t attr_id)
 Get registered attribute description by cluster descriptor. More...
 
zb_zcl_attr_tzb_zcl_get_attr_desc_manuf (zb_zcl_cluster_desc_t *cluster_desc, zb_uint16_t attr_id, zb_uint16_t manuf_code)
 Get registered attribute description by cluster descriptor. More...
 
zb_uint8_t zb_zcl_check_attribute_writable (zb_zcl_attr_t *attr_desc, zb_uint8_t endpoint, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint8_t *new_value, zb_bool_t check_access)
 Check registered attribute is writable one. More...
 
void zb_zcl_write_attr_hook (zb_uint8_t endpoint, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint16_t attr_id, zb_uint8_t *new_value, zb_uint16_t manuf_code)
 
void zb_zcl_set_attr_val_post_process_cluster_specific (zb_zcl_parsed_hdr_t *cmd_info, zb_uint16_t attr_id, zb_uint8_t *value)
 
zb_uint8_t zb_zcl_get_attribute_size (zb_uint8_t attr_type, zb_uint8_t *attr_value)
 Get size of value of given attribute type. More...
 
zb_uint8_t zb_zcl_get_analog_attribute_size (zb_uint8_t attr_type)
 Get size of analog data type. More...
 
zb_bool_t zb_zcl_is_analog_data_type (zb_uint8_t attr_type)
 Check whether type of ZCL attribute is analog. More...
 
zb_ret_t zb_zcl_check_attr_value (zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint8_t *value)
 Check if attribute value is valid or not. More...
 
zb_ret_t zb_zcl_check_attr_value_manuf (zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint16_t manuf_code, zb_uint8_t *value)
 Check if attribute value is valid or not (with manufacturer specific code) More...
 
zb_bool_t zb_zcl_is_target_endpoint (zb_af_endpoint_desc_t *ep_desc, zb_uint16_t profile_id)
 
zb_uint8_t zb_zcl_get_next_target_endpoint (zb_uint8_t start_from_ep, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint16_t profile_id)
 
zb_zcl_cluster_desc_tget_cluster_desc (const zb_af_endpoint_desc_t *ep_desc, zb_uint16_t cluster_id, zb_uint8_t cluster_role)
 Search endpoint for cluster with given id. More...
 
zb_uint8_t get_endpoint_by_cluster (zb_uint16_t cluster_id, zb_uint8_t cluster_role)
 Find endpoint which has cluster with given ID. More...
 
zb_bool_t is_cluster_present (zb_uint16_t cluster_id)
 Find if device has cluster with given ID. More...
 
zb_uint16_t get_profile_id_by_endpoint (zb_uint8_t endpoint_id)
 
zb_af_endpoint_desc_tget_endpoint_by_cluster_with_role (zb_uint16_t cluster_id, zb_uint8_t cluster_role)
 Find endpoint which has cluster with given ID and role. More...
 
zb_zcl_attr_tzb_zcl_get_attr_desc_a (zb_uint8_t ep, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint16_t attr_id)
 
zb_zcl_attr_tzb_zcl_get_attr_desc_manuf_a (zb_uint8_t ep, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint16_t attr_id, zb_uint16_t manuf_code)
 
zb_uint8_tzb_zcl_put_value_to_packet (zb_uint8_t *cmd_ptr, zb_uint8_t attr_type, zb_uint8_t *attr_value)
 
zb_zcl_status_t zb_zcl_set_attr_val_manuf (zb_uint8_t ep, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint16_t attr_id, zb_uint16_t manuf_code, zb_uint8_t *value, zb_bool_t check_access)
 Sets value for manufacture-specific attribute. Also, perform all needed checks before and after setting new value. More...
 
zb_zcl_status_t zb_zcl_set_attr_val (zb_uint8_t ep, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint16_t attr_id, zb_uint8_t *value, zb_bool_t check_access)
 Sets attribute value, perform all needed checks before and after setting new value. More...
 
zb_ret_t zb_zcl_register_cb (zb_uint8_t param, zb_callback_t cb)
 Register callback that should be called when APS acknowledge is received for ZCL command. More...
 
zb_ret_t zb_zcl_ack_callback (zb_uint8_t param)
 Call callback on receiving APS acknowledge for ZCL command. More...
 
zb_uint8_t zb_zcl_check_accept_command (zb_uint8_t param)
 
zb_ret_t zb_zcl_set_backward_comp_mode (zb_uint8_t mode)
 Set ZCL backward compatibility modes. More...
 
zb_uint8_t zb_zcl_get_backward_comp_mode (void)
 Get ZCL backward compatibility modes. More...
 
zb_uint16_t zb_zcl_get_cluster_rev_by_mode (zb_uint16_t api_revision, const zb_addr_u *dst_addr, zb_uint8_t dst_addr_mode, zb_uint8_t dst_ep, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint8_t src_ep)
 Get cluster revision depending on current ZCL backward compatibility mode, see zcl_backward_compatibility_modes. More...
 
zb_ret_t zb_zcl_set_peer_revision_callback (zb_zcl_peer_revision_cb_t cb)
 Set peer revision callback, see zb_zcl_peer_revision_cb_t If the callback is set, ZB_ZCL_COMPATIBILITY_MODE will be enabled automatically. More...
 
zb_uint8_t zb_zcl_get_backward_compatible_statuses_mode (void)
 Returns Backward compatible status values mode When enabled it diversifies some common statuses as it was in ZCL6 and ZCL7. More...
 
zb_ret_t zb_zcl_set_backward_compatible_statuses_mode (zb_uint8_t statuses_mode)
 Set Backward compatible status values mode. More...
 
void zb_zcl_schedule_status_abort (zb_bufid_t buffer, zb_addr_u *addr, zb_uint8_t dst_addr_mode, zb_uint8_t dst_ep, zb_uint8_t ep, zb_callback_t cb)
 
zb_bool_t zb_zcl_handle_specific_commands (zb_uint8_t param)
 
zb_bool_t cluster_needs_aps_encryption (zb_uint8_t endpoint_id, zb_uint16_t cluster_id)
 
zb_zcl_status_t zb_zcl_set_attr_val_manuf_internal (zb_uint8_t ep, zb_uint16_t cluster_id, zb_uint8_t cluster_role, zb_uint16_t attr_id, zb_uint16_t manuf_code, zb_uint8_t *value, zb_bool_t check_access, zb_bool_t check_attr_writable)
 
zb_zcl_status_t zb_zcl_map_ret_code_to_zcl_status (zb_ret_t ret_code)
 Map return code to ZCL status code. More...
 

Macro Definition Documentation

§ ZB_COMPILE_ZCL_SAMPLE

#define ZB_COMPILE_ZCL_SAMPLE

§ ZB_ZCL_ATTRIB_LIST_GET_COUNT

#define ZB_ZCL_ATTRIB_LIST_GET_COUNT (   list)    ZB_ARRAY_SIZE((list)) - 2

§ ZB_ZCL_ATTRIB_LIST_GET_PTR

#define ZB_ZCL_ATTRIB_LIST_GET_PTR (   list)    (zb_zcl_attr_t *)(list) + 1

Function Documentation

§ cluster_needs_aps_encryption()

zb_bool_t cluster_needs_aps_encryption ( zb_uint8_t  endpoint_id,
zb_uint16_t  cluster_id 
)

§ zb_zcl_handle_specific_commands()

zb_bool_t zb_zcl_handle_specific_commands ( zb_uint8_t  param)

§ zb_zcl_map_ret_code_to_zcl_status()

zb_zcl_status_t zb_zcl_map_ret_code_to_zcl_status ( zb_ret_t  ret_code)

Map return code to ZCL status code.

Parameters
ret_code- return code from command handler
Returns
zb_zcl_status_t according ret_code

§ zb_zcl_schedule_status_abort()

void zb_zcl_schedule_status_abort ( zb_bufid_t  buffer,
zb_addr_u addr,
zb_uint8_t  dst_addr_mode,
zb_uint8_t  dst_ep,
zb_uint8_t  ep,
zb_callback_t  cb 
)

§ zb_zcl_set_attr_val_manuf_internal()

zb_zcl_status_t zb_zcl_set_attr_val_manuf_internal ( zb_uint8_t  ep,
zb_uint16_t  cluster_id,
zb_uint8_t  cluster_role,
zb_uint16_t  attr_id,
zb_uint16_t  manuf_code,
zb_uint8_t value,
zb_bool_t  check_access,
zb_bool_t  check_attr_writable 
)