Tizen Native API
5.0
|
Zigbee global commands.
#include <zigbee.h>
Global command frames are used for manipulating attributes and other general tasks that are not specific to an individual cluster.
The command frames defined in this section.
Each command frame shall be constructed with the frame type sub-field of the frame control field set to 0b00.
All clusters (server and client) shall support generation, reception and execution of the Default response command.
Each cluster (server or client) that implements attributes shall support reception of, execution of, and response to all commands to discover, read, and write these attributes. However, if no attributes with structured types are supported, it is not required to support the structured read and write commands.
Implementation of commands to report, configure reporting of, and read reporting configuration of attributes is only mandatory if the cluster has attributes whose reportability is mandatory.
Generation of these commands is application dependent
Functions | |
int | zb_zcl_global_attr_read (zb_zigbee_h handle, zb_nwk_addr addr16, zb_end_point src_ep, zb_end_point dst_ep, zb_zcl_frame_ctl zcl_fc, zb_cluster_id clusterid, zb_attribute_id *attribute_ids, int count, zb_zcl_global_attr_read_cb cb, void *user_data) |
Sends 'read attributes' command. | |
int | zb_zcl_global_attr_write (zb_zigbee_h handle, zb_nwk_addr addr16, zb_end_point src_ep, zb_end_point dst_ep, zb_zcl_frame_ctl zcl_fc, zb_cluster_id clusterid, zb_zcl_write_attr_record_h *records, int count, zb_zcl_global_attr_write_cb cb, void *user_data) |
Sends 'write Attributes' command. | |
int | zb_zcl_global_attr_write_undivided (zb_zigbee_h handle, zb_nwk_addr addr16, zb_end_point src_ep, zb_end_point dst_ep, zb_zcl_frame_ctl zcl_fc, zb_cluster_id clusterid, zb_zcl_write_attr_record_h *records, int count, zb_zcl_global_attr_write_cb cb, void *user_data) |
Sends 'write attributes undivided' command. | |
int | zb_zcl_global_attr_write_no_rsp (zb_zigbee_h handle, zb_nwk_addr addr16, zb_end_point src_ep, zb_end_point dst_ep, zb_zcl_frame_ctl zcl_fc, zb_cluster_id clusterid, zb_zcl_write_attr_record_h *records, int count) |
Sends 'write Attributes without response' command. | |
int | zb_zcl_global_config_report_write (zb_zigbee_h handle, zb_nwk_addr addr16, zb_end_point src_ep, zb_end_point dst_ep, zb_zcl_frame_ctl zcl_fc, zb_cluster_id clusterid, zb_zcl_reporting_config_record_h *records, int count, zb_zcl_global_config_report_write_cb cb, void *user_data) |
Sends 'setting configure reporting' command. | |
int | zb_zcl_global_config_report_read (zb_zigbee_h handle, zb_nwk_addr addr16, zb_end_point src_ep, zb_end_point dst_ep, zb_zcl_frame_ctl zcl_fc, zb_cluster_id clusterid, zb_zcl_read_report_config_record_h *records, int count, zb_zcl_global_config_report_read_cb cb, void *user_data) |
Sends 'reading configure reporting' command. | |
Typedefs | |
typedef unsigned char | zb_zcl_frame_ctl |
The data type abbreviation : Zigbee ZCL frame control. | |
typedef void * | zb_zcl_read_attr_status_record_h |
Format of the Attribute Status Record in Zigbee Cluster Library. | |
typedef void * | zb_zcl_write_attr_record_h |
Format of the Write Attributes Data Structure in Zigbee Cluster Library. | |
typedef void * | zb_zcl_write_attr_status_record_h |
Format of the write attribute status record in Zigbee Cluster Library. | |
typedef void * | zb_zcl_reporting_config_record_h |
Format of Reporting Configuration Record Structure in Zigbee Cluster Library. | |
typedef void * | zb_zcl_read_report_config_record_h |
Format of Read Reporting Configuration Record in Zigbee Cluster Library. | |
typedef void * | zb_zcl_report_config_response_record_h |
Format of the Attribute Status Record Field in Zigbee Cluster Library. | |
typedef void(* | zb_zcl_global_attr_read_cb )(zb_nwk_addr addr16, zb_end_point ep, zb_cluster_id clusterid, zb_zcl_read_attr_status_record_h *records, int count, void *user_data) |
Called with device attributes. | |
typedef void(* | zb_zcl_global_attr_write_cb )(zb_nwk_addr addr16, zb_end_point ep, zb_cluster_id clusterid, zb_zcl_write_attr_status_record_h *records, int count, void *user_data) |
Called when write attributes command are requested. | |
typedef void(* | zb_zcl_global_config_report_write_cb )(zb_nwk_addr addr16, zb_end_point ep, zb_cluster_id clusterid, zb_zcl_report_config_response_record_h *records, int count, void *user_data) |
Called with configure reporting response. | |
typedef void(* | zb_zcl_global_config_report_read_cb )(zb_nwk_addr addr16, zb_end_point ep, zb_cluster_id clusterid, zb_zcl_reporting_config_record_h *records, int count, void *user_data) |
Called with a configuration report. | |
Defines | |
#define | ZB_ZCL_FC_DEFAULT 0x00 |
Default ZCL frame control at APS Header. |
#define ZB_ZCL_FC_DEFAULT 0x00 |
Default ZCL frame control at APS Header.
typedef unsigned char zb_zcl_frame_ctl |
The data type abbreviation : Zigbee ZCL frame control.
typedef void(* zb_zcl_global_attr_read_cb)(zb_nwk_addr addr16, zb_end_point ep, zb_cluster_id clusterid, zb_zcl_read_attr_status_record_h *records, int count, void *user_data) |
Called with device attributes.
This callback is called when device attributes are requested with zb_zcl_global_attr_read().
[out] | addr16 | The source network address |
[out] | ep | The source end-point of the received information (ex. endpoint 1) |
[out] | clusterid | ZCL cluster id |
[out] | records | Attribute status record |
[out] | count | The number of items in records |
[out] | user_data | User data |
typedef void(* zb_zcl_global_attr_write_cb)(zb_nwk_addr addr16, zb_end_point ep, zb_cluster_id clusterid, zb_zcl_write_attr_status_record_h *records, int count, void *user_data) |
Called when write attributes command are requested.
This callback is called when attributes are written with zb_zcl_global_attr_write() or zb_zcl_global_attr_write_undivided(). In other words, the write attributes response is generated in response to the write attributes command.
[out] | addr16 | The source network address |
[out] | ep | The source end-point of the received information (ex. endpoint 1) |
[out] | clusterid | ZCL cluster id |
[out] | records | Attribute status record |
[out] | count | The number of items in records |
[out] | user_data | User data |
typedef void(* zb_zcl_global_config_report_read_cb)(zb_nwk_addr addr16, zb_end_point ep, zb_cluster_id clusterid, zb_zcl_reporting_config_record_h *records, int count, void *user_data) |
Called with a configuration report.
This callback is called after zb_zcl_global_config_report_read() is called.
[out] | addr16 | Source network address |
[out] | ep | The source end-point (ex. 1) |
[out] | clusterid | ZCL cluster id |
[out] | records | Read reporting configuration response record |
[out] | count | The number of items in records |
[out] | user_data | User data |
typedef void(* zb_zcl_global_config_report_write_cb)(zb_nwk_addr addr16, zb_end_point ep, zb_cluster_id clusterid, zb_zcl_report_config_response_record_h *records, int count, void *user_data) |
Called with configure reporting response.
This callback is called after zb_zcl_global_config_report_write() is called.
[out] | addr16 | The source network address |
[out] | ep | The source from which the response was sent (ex. 1) |
[out] | clusterid | ZCL cluster id |
[out] | records | Reporting configuration response record |
[out] | count | The number of reporting configuration response record |
[out] | user_data | User data |
typedef void* zb_zcl_read_attr_status_record_h |
Format of the Attribute Status Record in Zigbee Cluster Library.
typedef void* zb_zcl_read_report_config_record_h |
Format of Read Reporting Configuration Record in Zigbee Cluster Library.
typedef void* zb_zcl_report_config_response_record_h |
Format of the Attribute Status Record Field in Zigbee Cluster Library.
typedef void* zb_zcl_reporting_config_record_h |
Format of Reporting Configuration Record Structure in Zigbee Cluster Library.
typedef void* zb_zcl_write_attr_record_h |
Format of the Write Attributes Data Structure in Zigbee Cluster Library.
typedef void* zb_zcl_write_attr_status_record_h |
Format of the write attribute status record in Zigbee Cluster Library.
enum zb_aps_ack_request_e |
enum zb_zcl_acl_type_e |
enum zb_zcl_data_type_e |
ZCL attribute types (See zb_zcl_data_type_e).
Zigbee devices, such as thermostats, lamps, etc., are defined in terms of the attributes they contain, which can be written, read or reported using the commands defined in zb_zcl_data_type_e details the data types and formats that can be used for these attributes. Note that individual clusters, which may use different or new types, show valid values, ranges, and units for the attributes they represent.
Each data type is allocated an 8-bit data type ID. The most significant 5 bits of this ID is used to divide the types into 32 type classes, and the least significant 3 bits specify a specific data type within this class.
zb_zcl_data_type_e also indicates for each data type whether it is considered to be 'analog' or 'discrete'. Values of analog types may be added to or subtracted from other values of the same type, and are typically used to measure the value of properties in the real world that vary continuously over a range. Values of discrete data types only have meaning as individual values, and may not be added or subtracted.
enum zb_zcl_fc_type_e |
int zb_zcl_global_attr_read | ( | zb_zigbee_h | handle, |
zb_nwk_addr | addr16, | ||
zb_end_point | src_ep, | ||
zb_end_point | dst_ep, | ||
zb_zcl_frame_ctl | zcl_fc, | ||
zb_cluster_id | clusterid, | ||
zb_attribute_id * | attribute_ids, | ||
int | count, | ||
zb_zcl_global_attr_read_cb | cb, | ||
void * | user_data | ||
) |
Sends 'read attributes' command.
Call this function to read attributes of devices.
[in] | handle | The handle of zigbee |
[in] | addr16 | target network address |
[in] | src_ep | source end-point (ex. 1) |
[in] | dst_ep | destination end-point (ex. 1) |
[in] | zcl_fc | frame control bits (default ZB_ZCL_FC_DEFAULT). Only OR operation is allowed in ZCL header
|
[in] | clusterid | ZCL cluster id |
[in] | attribute_ids | Attributes_ids-list |
[in] | count | The number of items in the attribute_ids list |
[in] | cb | Response callback function |
[in] | user_data | User data |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_INVALID_ADDRESS | Invalid address |
ZIGBEE_ERROR_OUT_OF_MEMORY | Out-of-memory |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_zcl_global_attr_write | ( | zb_zigbee_h | handle, |
zb_nwk_addr | addr16, | ||
zb_end_point | src_ep, | ||
zb_end_point | dst_ep, | ||
zb_zcl_frame_ctl | zcl_fc, | ||
zb_cluster_id | clusterid, | ||
zb_zcl_write_attr_record_h * | records, | ||
int | count, | ||
zb_zcl_global_attr_write_cb | cb, | ||
void * | user_data | ||
) |
Sends 'write Attributes' command.
Call this function to write attributes of other devices.
[in] | handle | The handle of zigbee |
[in] | addr16 | target network address |
[in] | src_ep | source end-point (ex. 1) |
[in] | dst_ep | destination end-point (ex. 1) |
[in] | zcl_fc | frame control bits (default ZB_ZCL_FC_DEFAULT). Only OR operation is allowed in ZCL header
|
[in] | clusterid | ZCL cluster id |
[in] | records | Array of zb_zcl_write_attr_record_h |
[in] | count | The number of items in records array |
[in] | cb | Response callback function |
[in] | user_data | User data |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_INVALID_ADDRESS | Invalid address |
ZIGBEE_ERROR_OUT_OF_MEMORY | Out-of-memory |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_zcl_global_attr_write_no_rsp | ( | zb_zigbee_h | handle, |
zb_nwk_addr | addr16, | ||
zb_end_point | src_ep, | ||
zb_end_point | dst_ep, | ||
zb_zcl_frame_ctl | zcl_fc, | ||
zb_cluster_id | clusterid, | ||
zb_zcl_write_attr_record_h * | records, | ||
int | count | ||
) |
Sends 'write Attributes without response' command.
Call this function to write attributes of other devices without receiving any response.
[in] | handle | The handle of zigbee |
[in] | addr16 | target network address |
[in] | src_ep | source end-point (ex. 1) |
[in] | dst_ep | destination end-point (ex. 1) |
[in] | zcl_fc | frame control bits (default ZB_ZCL_FC_DEFAULT). Only OR operation is allowed in ZCL header
|
[in] | clusterid | ZCL cluster id |
[in] | records | Array of zb_zcl_write_attr_record_h |
[in] | count | The number of items in records array |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_INVALID_ADDRESS | Invalid address |
ZIGBEE_ERROR_OUT_OF_MEMORY | Out-of-memory |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_zcl_global_attr_write_undivided | ( | zb_zigbee_h | handle, |
zb_nwk_addr | addr16, | ||
zb_end_point | src_ep, | ||
zb_end_point | dst_ep, | ||
zb_zcl_frame_ctl | zcl_fc, | ||
zb_cluster_id | clusterid, | ||
zb_zcl_write_attr_record_h * | records, | ||
int | count, | ||
zb_zcl_global_attr_write_cb | cb, | ||
void * | user_data | ||
) |
Sends 'write attributes undivided' command.
Call this function to write attributes without fragmentation to other devices.
[in] | handle | The handle of zigbee |
[in] | addr16 | target network address |
[in] | src_ep | source end-point (ex. 1) |
[in] | dst_ep | destination end-point (ex. 1) |
[in] | zcl_fc | frame control bits (default ZB_ZCL_FC_DEFAULT). Only OR operation is allowed in ZCL header
|
[in] | clusterid | ZCL cluster id |
[in] | records | Array of zb_zcl_write_attr_record_h |
[in] | count | The number of items in records array |
[in] | cb | Response callback function |
[in] | user_data | User data |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_INVALID_ADDRESS | Invalid address |
ZIGBEE_ERROR_OUT_OF_MEMORY | Out-of-memory |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_zcl_global_config_report_read | ( | zb_zigbee_h | handle, |
zb_nwk_addr | addr16, | ||
zb_end_point | src_ep, | ||
zb_end_point | dst_ep, | ||
zb_zcl_frame_ctl | zcl_fc, | ||
zb_cluster_id | clusterid, | ||
zb_zcl_read_report_config_record_h * | records, | ||
int | count, | ||
zb_zcl_global_config_report_read_cb | cb, | ||
void * | user_data | ||
) |
Sends 'reading configure reporting' command.
Call this function to read the configuration of attribute status changing reporting.
[in] | handle | The handle of zigbee |
[in] | addr16 | target network address |
[in] | src_ep | source end-point (ex. 1) |
[in] | dst_ep | destination end-point (ex. 1) |
[in] | zcl_fc | frame control bits (default ZB_ZCL_FC_DEFAULT). Only OR operation is allowed in ZCL header
|
[in] | clusterid | ZCL cluster id |
[in] | records | Array of zb_zcl_read_report_config_record_h |
[in] | count | The number of items in records array |
[in] | cb | Response callback function |
[in] | user_data | User data |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_INVALID_ADDRESS | Invalid address |
ZIGBEE_ERROR_OUT_OF_MEMORY | Out-of-memory |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_zcl_global_config_report_write | ( | zb_zigbee_h | handle, |
zb_nwk_addr | addr16, | ||
zb_end_point | src_ep, | ||
zb_end_point | dst_ep, | ||
zb_zcl_frame_ctl | zcl_fc, | ||
zb_cluster_id | clusterid, | ||
zb_zcl_reporting_config_record_h * | records, | ||
int | count, | ||
zb_zcl_global_config_report_write_cb | cb, | ||
void * | user_data | ||
) |
Sends 'setting configure reporting' command.
Call this function to set the configuration of attribute status changing reporting.
[in] | handle | The handle of zigbee |
[in] | addr16 | target network address |
[in] | src_ep | source end-point (ex. 1) |
[in] | dst_ep | destination end-point (ex. 1) |
[in] | zcl_fc | frame control bits (default ZB_ZCL_FC_DEFAULT). Only OR operation is allowed in ZCL header
|
[in] | clusterid | ZCL cluster id |
[in] | records | Array of zb_zcl_reporting_config_record_h |
[in] | count | The number of items in records array |
[in] | cb | Response callback function |
[in] | user_data | User data |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_INVALID_ADDRESS | Invalid address |
ZIGBEE_ERROR_OUT_OF_MEMORY | Out-of-memory |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |