
Modules | |
| ZCL common types | |
Data Structures | |
| struct | zb_zcl_command_send_status_s |
Macros | |
| #define | ZB_ZCL_FIX_ENDIAN(data_ptr, data_type) |
| Fix data endian, if needed, and store it in the same buffer. More... | |
Typedefs | |
| 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... | |
Functions | |
| zb_zcl_attr_t * | zb_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_t * | zb_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_t * | get_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_t * | get_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_t * | zb_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_t * | zb_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_t * | zb_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... | |
| #define ZB_ZCL_FIX_ENDIAN | ( | data_ptr, | |
| data_type | |||
| ) |
Fix data endian, if needed, and store it in the same buffer.
| data_ptr | - pointer to data value |
| data_type | - ZCL data type |
| 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.
| cluster_id | - Cluster ID |
| cluster_role | - cluster role (zcl_cluster_role) |
| endpoint | - endpoint number |
| attr_id | - attribute ID |
| value | - new attribute value |
| 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.
| cluster_id | - Cluster ID |
| cluster_role | - cluster role (zcl_cluster_role) |
| endpoint | - endpoint number |
| attr_id | - attribute ID |
| manuf_code | - manufacturer specific code |
| value | - new attribute value |
| typedef struct zb_zcl_command_send_status_s zb_zcl_command_send_status_t |
Command send status structure
| 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.
| ieee_addr | - IEEE address |
| cluster_id | - Cluster ID |
| cluster_role | - cluster role (zcl_cluster_role) |
| endpoint | - endpoint number |
| typedef void(* zb_zcl_set_default_value_attr_cb_t) (zb_uint8_t ep) |
Set default value attribute callback.
| ep | - endpoint number |
| zb_zcl_cluster_desc_t* get_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.
| ep_desc | - application endpoint description |
| cluster_id | - cluster ID (see zcl_cluster_id) |
| cluster_role | - role (see zcl_cluster_role) |
| 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.
| cluster_id | - cluster ID (see zcl_cluster_id) |
| cluster_role | - role (see zcl_cluster_role) |
| zb_af_endpoint_desc_t* get_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.
| cluster_id | - cluster ID (see zcl_cluster_id) |
| cluster_role | - role (see zcl_cluster_role) |
| zb_bool_t is_cluster_present | ( | zb_uint16_t | cluster_id | ) |
Find if device has cluster with given ID.
| cluster_id | - cluster ID (see zcl_cluster_id) |
| zb_ret_t zb_zcl_ack_callback | ( | zb_uint8_t | param | ) |
Call callback on receiving APS acknowledge for ZCL command.
| param | - buffer with ZCL command |
| zb_uint8_t zb_zcl_check_accept_command | ( | zb_uint8_t | param | ) |
Check whether ZCL command should be handled by stack
| param | - reference to buffer with parsed ZCL command |
| 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.
| cluster_id | - cluster ID |
| cluster_role | - cluster role (zcl_cluster_role) |
| endpoint | - endpoint |
| attr_id | - attribute ID |
| value | - pointer to attribute data |
| 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)
| cluster_id | - cluster ID |
| cluster_role | - cluster role (zcl_cluster_role) |
| endpoint | - endpoint |
| attr_id | - attribute ID |
| manuf_code | - manufacturer specific code |
| value | - pointer to attribute data |
| 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.
| attr_desc | - attribute descriptor |
| endpoint | - endpoint |
| cluster_id | - cluster identifier |
| cluster_role | - cluster role (zcl_cluster_role) |
| new_value | - new value for an attribute |
| check_access | - check READ_ONLY access or not |
| zb_uint8_t zb_zcl_get_analog_attribute_size | ( | zb_uint8_t | attr_type | ) |
Get size of analog data type.
| attr_type | - attribute type in question (see zcl_attr_type) |
| zb_zcl_attr_t* zb_zcl_get_attr_desc | ( | zb_zcl_cluster_desc_t * | cluster_desc, |
| zb_uint16_t | attr_id | ||
| ) |
Get registered attribute description by cluster descriptor.
| cluster_desc | - cluster descriptor |
| attr_id | - attribute identifier |
| zb_zcl_attr_t* zb_zcl_get_attr_desc_a | ( | zb_uint8_t | ep, |
| zb_uint16_t | cluster_id, | ||
| zb_uint8_t | cluster_role, | ||
| zb_uint16_t | attr_id | ||
| ) |
Find attribute descriptor by given endpoint number, cluster ID and attribute ID
| ep | - endpoint number (must exist) |
| cluster_id | - cluster ID (must exist on given ep, see zb_zcl_cluster_id_t) |
| cluster_role | - role (see zcl_cluster_role) |
| attr_id | - attribute ID |
| zb_zcl_attr_t* zb_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.
| cluster_desc | - cluster descriptor |
| attr_id | - attribute identifier |
| manuf_code | - manufacturer specific ID |
| zb_zcl_attr_t* zb_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 | ||
| ) |
Find attribute descriptor by given endpoint number, cluster ID, attribute ID, and manuf code
| ep | - endpoint number (must exist) |
| cluster_id | - cluster ID (must exist on given ep, see zb_zcl_cluster_id_t) |
| cluster_role | - role (see zcl_cluster_role) |
| attr_id | - attribute ID |
| manuf_code | - manufacturer code |
| 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.
| attr_type | - attribute type in question (see zcl_attr_type) |
| attr_value | - pointer to value in question (needed for variable sized types) |
| zb_uint8_t zb_zcl_get_backward_comp_mode | ( | void | ) |
Get ZCL backward compatibility modes.
| 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.
| 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.
| api_revision | - |
| dst_addr | destination address pointer (see zb_addr_u) |
| dst_addr_mode | destination address mode (only ZB_APS_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT and ZB_APS_ADDR_MODE_16_ENDP_PRESENT are supported) |
| dst_ep | destination endpoint |
| cluster_id | cluster identifier |
| cluster_role | cluster role |
| src_ep | source endpoint |
| zb_bool_t zb_zcl_is_analog_data_type | ( | zb_uint8_t | attr_type | ) |
Check whether type of ZCL attribute is analog.
| attr_type | - attribute type in question (see zcl_attr_type) |
| zb_uint8_t* zb_zcl_put_value_to_packet | ( | zb_uint8_t * | cmd_ptr, |
| zb_uint8_t | attr_type, | ||
| zb_uint8_t * | attr_value | ||
| ) |
Put attribute value to command packet, fix endian if needed.
| cmd_ptr | - pointer to destination |
| attr_type | - type of attribute being written (see zcl_attr_type) |
| attr_value | - pointer to value to be put into packet |
| 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.
| param | - pointer to buffer with ZCL command |
| cb | - pointer to callback function |
| 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.
| ep | - endpoint number |
| cluster_id | - cluster ID (see zb_zcl_cluster_id_t) |
| cluster_role | - role (see zcl_cluster_role) |
| attr_id | - ID of the attribute being set |
| value | - pointer to new value |
| check_access | - whether read-only check should be performed |
| 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.
| ep | - endpoint number |
| cluster_id | - cluster ID (see zb_zcl_cluster_id_t) |
| cluster_role | - role (see zcl_cluster_role) |
| attr_id | - ID of the attribute being set |
| value | - pointer to new value |
| check_access | - whether read-only check should be performed |
| manuf_code | - manufacturer code attribute |
| 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 | ||
| ) |
Set attribute value cluster specific postprocessing
| cmd_info | - cluster role (zcl_cluster_role) |
| attr_id | - attribute ID |
| value | - new value of attribute |
| zb_ret_t zb_zcl_set_backward_comp_mode | ( | zb_uint8_t | mode | ) |
Set ZCL backward compatibility modes.
ZB_ZCL_LEGACY_MODE is default mode
| mode | - see zcl_backward_compatibility_modes |
| zb_ret_t zb_zcl_set_backward_compatible_statuses_mode | ( | zb_uint8_t | statuses_mode | ) |
Set Backward compatible status values mode.
| statuses_mode | - see zcl_backward_compatibility_status_modes |
| 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.
| cb | - peer revision callback, NULL if the callback should be removed |
| 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 | ||
| ) |
Hook on Write Attribute command
| endpoint | - endpoint |
| cluster_id | - cluster ID |
| cluster_role | - cluster role (zcl_cluster_role) |
| attr_id | - attribute ID |
| new_value | - pointer to newly assigned value |
| manuf_code | - manufacturer specific code |