Modules | |
Device types | |
Data Structures | |
struct | zb_af_node_desc_s |
struct | zb_af_node_power_desc_s |
struct | zb_af_simple_desc_1_1_s |
struct | zb_af_simple_desc_8_9_s |
struct | zb_af_endpoint_desc_s |
Endpoint descriptor. More... | |
Macros | |
#define | ZB_AF_SIMPLE_DESC_TYPE(in_num, out_num) __CAT__(zb_af_simple_desc_,in_num,_,out_num,_t) |
#define | ZB_DECLARE_SIMPLE_DESC(in_clusters_count, out_clusters_count) |
#define | ZB_AF_IS_EP_REGISTERED(_ep) (zb_af_get_endpoint_desc( _ep ))?(ZB_TRUE):(ZB_FALSE) |
Check endpoint registration in ZCL. More... | |
#define | ZB_AF_START_DECLARE_ENDPOINT_LIST(ep_list_name) zb_af_endpoint_desc_t *ep_list_name[] = { |
#define | ZB_AF_DECLARE_ENDPOINT_DESC(ep_name,ep_id,profile_id,reserved_length,reserved_ptr,cluster_number,cluster_list,simple_desc,rep_count,rep_ctx,lev_ctrl_count,lev_ctrl_ctx) |
Initialize endpoint descriptor. More... | |
#define | ZB_AF_FINISH_DECLARE_ENDPOINT_LIST } |
#define | ZB_AF_SET_ENDPOINT_HANDLER(endpoint, handler) (zb_af_get_endpoint_desc((endpoint))->device_handler = (handler)) |
Allows application to register cluster commands handler for a specific endpoint. More... | |
#define | ZB_AF_SET_IDENTIFY_NOTIFICATION_HANDLER(endpoint, handler) (zb_af_get_endpoint_desc((endpoint))->identify_handler = (handler)) |
Sets identify notification handler for endpoint. More... | |
#define | ZB_AF_DECLARE_DEVICE_CTX(device_ctx_name, ep_list_name, ep_count, reporting_attr_count) |
#define | ZB_AF_DECLARE_DEVICE_CTX_NO_REP(device_ctx_name, ep_list_name, ep_count) |
#define | ZBOSS_DEVICE_DECLARE_REPORTING_CTX(rep_ctx, rep_count) zb_zcl_reporting_info_t rep_ctx[rep_count] |
#define | ZBOSS_DEVICE_DECLARE_LEVEL_CONTROL_CTX(lev_ctrl_ctx, lev_ctrl_count) zb_zcl_cvc_alarm_variables_t lev_ctrl_ctx[lev_ctrl_count] |
#define | ZBOSS_DECLARE_DEVICE_CTX(device_ctx_name, ep_list_name, ep_count) |
#define | ZBOSS_DECLARE_DEVICE_CTX_1_EP(device_ctx_name, ep_name) |
#define | ZBOSS_DECLARE_DEVICE_CTX_2_EP(device_ctx_name, ep1_name, ep2_name) |
#define | ZBOSS_DECLARE_DEVICE_CTX_3_EP(device_ctx_name, ep1_name, ep2_name, ep3_name) |
#define | ZBOSS_DECLARE_DEVICE_CTX_4_EP(device_ctx_name, ep1_name, ep2_name, ep3_name, ep4_name) |
#define | ZB_AF_REGISTER_DEVICE_CTX(_device_ctx) zb_af_register_device_ctx(_device_ctx) |
#define | ZB_ZCL_REGISTER_DEVICE_CB(func_ptr) |
Set Device user application callback. The macro sets a callback being called upon to need inform User App about change device attribute or need to execute H/W command. More... | |
Typedefs | |
typedef struct zb_af_node_desc_s | zb_af_node_desc_t |
typedef zb_nwk_device_type_t | zb_logical_type_t |
typedef enum zb_current_power_mode_e | zb_current_power_mode_t |
typedef enum zb_power_src_e | zb_power_src_t |
typedef enum zb_power_source_level_e | zb_power_source_level_t |
typedef struct zb_af_node_power_desc_s | zb_af_node_power_desc_t |
typedef struct zb_af_simple_desc_1_1_s | zb_af_simple_desc_1_1_t |
typedef struct zb_af_simple_desc_8_9_s | zb_af_simple_desc_8_9_t |
typedef enum zb_af_cmd_transmission_status_e | zb_af_cmd_transmission_status_t |
typedef zb_uint8_t(* | zb_device_handler_t )(zb_uint8_t param) |
typedef struct zb_af_endpoint_desc_s | zb_af_endpoint_desc_t |
Endpoint descriptor. More... | |
typedef void(* | zb_af_transmission_res_cb_t )(zb_uint8_t status) |
Functions | |
void | zb_set_simple_descriptor (zb_af_simple_desc_1_1_t *simple_desc, zb_uint8_t endpoint, zb_uint16_t app_profile_id, zb_uint16_t app_device_id, zb_bitfield_t app_device_version, zb_uint8_t app_input_cluster_count, zb_uint8_t app_output_cluster_count) |
void | zb_set_input_cluster_id (zb_af_simple_desc_1_1_t *simple_desc, zb_uint8_t cluster_number, zb_uint16_t cluster_id) |
void | zb_set_output_cluster_id (zb_af_simple_desc_1_1_t *simple_desc, zb_uint8_t cluster_number, zb_uint16_t cluster_id) |
Set output cluster item. More... | |
void | zb_set_default_ffd_descriptor_values (zb_logical_type_t device_type) |
void | zb_set_default_ed_descriptor_values (void) |
zb_af_endpoint_desc_t * | zb_af_get_endpoint_desc (zb_uint8_t ep_id) |
Search for endpoint (device) descriptor by endpoint ID. More... | |
void | zb_af_set_data_indication (zb_device_handler_t cb) |
Set up application callback to be called for APS data packets. More... | |
void | zb_bdb_reset_via_local_action (zb_uint8_t param) |
Perform "Reset with a Local Action" procedure (as described in BDB spec, chapter 9.5). The device will perform the NLME leave and clean all ZigBee persistent data except the outgoing NWK frame counter and application datasets (if any). The reset can be performed at any time once the device is started (see zboss_start). After the reset, the application will receive the ZB_ZDO_SIGNAL_LEAVE signal. More... | |
#define ZB_AF_DECLARE_DEVICE_CTX | ( | device_ctx_name, | |
ep_list_name, | |||
ep_count, | |||
reporting_attr_count | |||
) |
#define ZB_AF_DECLARE_DEVICE_CTX_NO_REP | ( | device_ctx_name, | |
ep_list_name, | |||
ep_count | |||
) |
#define ZB_AF_DECLARE_ENDPOINT_DESC | ( | ep_name, | |
ep_id, | |||
profile_id, | |||
reserved_length, | |||
reserved_ptr, | |||
cluster_number, | |||
cluster_list, | |||
simple_desc, | |||
rep_count, | |||
rep_ctx, | |||
lev_ctrl_count, | |||
lev_ctrl_ctx | |||
) |
Initialize endpoint descriptor.
ep_name | - endpoint name |
ep_id | - endpoint id |
profile_id | - id of profile deployed on this endpoint |
reserved_length | - unused parameter |
reserved_ptr | - unused parameter |
cluster_number | - number of clusters delpoyed on endpoint |
cluster_list | - pointer to cluster list structure |
simple_desc | - pointer to simple descriptor structure |
rep_count | - number of reporting info slots |
rep_ctx | - pointer to attributes reporting information |
lev_ctrl_count | - number of continuous value change alarm slots |
lev_ctrl_ctx | - pointer to CVC context |
#define ZB_AF_FINISH_DECLARE_ENDPOINT_LIST } |
Finishes endpoint list declaration
#define ZB_AF_IS_EP_REGISTERED | ( | _ep | ) | (zb_af_get_endpoint_desc( _ep ))?(ZB_TRUE):(ZB_FALSE) |
Check endpoint registration in ZCL.
_ep | - identifier of the endpoint under consideration. |
#define ZB_AF_REGISTER_DEVICE_CTX | ( | _device_ctx | ) | zb_af_register_device_ctx(_device_ctx) |
Register device context.
_device_ctx | - Pointer to the device context |
Example:
#define ZB_AF_SET_ENDPOINT_HANDLER | ( | endpoint, | |
handler | |||
) | (zb_af_get_endpoint_desc((endpoint))->device_handler = (handler)) |
Allows application to register cluster commands handler for a specific endpoint.
endpoint | - Endpoint number |
handler | - Pointer to a function, function type zb_device_handler_t |
See HA samples
#define ZB_AF_SET_IDENTIFY_NOTIFICATION_HANDLER | ( | endpoint, | |
handler | |||
) | (zb_af_get_endpoint_desc((endpoint))->identify_handler = (handler)) |
Sets identify notification handler for endpoint.
Utilized by ZCL Identify cluster
endpoint | number |
handler | to set |
See HA samples
#define ZB_AF_SIMPLE_DESC_TYPE | ( | in_num, | |
out_num | |||
) | __CAT__(zb_af_simple_desc_,in_num,_,out_num,_t) |
Generate simple descriptor type name
#define ZB_AF_START_DECLARE_ENDPOINT_LIST | ( | ep_list_name | ) | zb_af_endpoint_desc_t *ep_list_name[] = { |
General macro to declare endpoint description list
ep_list_name | - name of ep list structure |
#define ZB_DECLARE_SIMPLE_DESC | ( | in_clusters_count, | |
out_clusters_count | |||
) |
Declares Simple descriptor type
in_clusters_count | - number of input clusters in desscriptor |
out_clusters_count | - number of output clusters in descriptor |
Example:
#define ZB_ZCL_REGISTER_DEVICE_CB | ( | func_ptr | ) |
Set Device user application callback. The macro sets a callback being called upon to need inform User App about change device attribute or need to execute H/W command.
func_ptr | - a callback to set (of type zb_callback_t). |
Example:
#define ZBOSS_DECLARE_DEVICE_CTX | ( | device_ctx_name, | |
ep_list_name, | |||
ep_count | |||
) |
Declare application's device context
device_ctx_name | - device context variable name |
ep_list_name | - name of endpoint list |
ep_count | - number of supported endpoints |
#define ZBOSS_DECLARE_DEVICE_CTX_1_EP | ( | device_ctx_name, | |
ep_name | |||
) |
Declare application's device context for single-endpoint device
Note that device has an additional Green Power endpoint if it is ZC or ZR and GPPB feature (Mandatory for Zigbee 3.0 ZC/ZR) is enabled.
device_ctx_name | - device context variable name |
ep_name | - variable holding endpoint context |
#define ZBOSS_DECLARE_DEVICE_CTX_2_EP | ( | device_ctx_name, | |
ep1_name, | |||
ep2_name | |||
) |
Declare application's device context for two-endpoint device
Note that device has an additional Green Power endpoint if it is ZC or ZR and GPPB feature (Mandatory for Zigbee 3.0 ZC/ZR) is enabled.
device_ctx_name | - device context variable name |
ep1_name | - variable holding context for endpoint 1 |
ep2_name | - variable holding context for endpoint 2 |
#define ZBOSS_DECLARE_DEVICE_CTX_3_EP | ( | device_ctx_name, | |
ep1_name, | |||
ep2_name, | |||
ep3_name | |||
) |
Declare application's device context for three-endpoint device
Note that device has an additional Green Power endpoint if it is ZC or ZR and GPPB feature (Mandatory for Zigbee 3.0 ZC/ZR) is enabled.
device_ctx_name | - device context variable name |
ep1_name | - variable holding context for endpoint 1 |
ep2_name | - variable holding context for endpoint 2 |
ep3_name | - variable holding context for endpoint 3 |
#define ZBOSS_DECLARE_DEVICE_CTX_4_EP | ( | device_ctx_name, | |
ep1_name, | |||
ep2_name, | |||
ep3_name, | |||
ep4_name | |||
) |
Declare application's device context for for-endpoint device
Note that device has an additional Green Power endpoint if it is ZC or ZR and GPPB feature (Mandatory for Zigbee 3.0 ZC/ZR) is enabled.
device_ctx_name | - device context variable name |
ep1_name | - variable holding context for endpoint 1 |
ep2_name | - variable holding context for endpoint 2 |
ep3_name | - variable holding context for endpoint 3 |
ep4_name | - variable holding context for endpoint 4 |
#define ZBOSS_DEVICE_DECLARE_LEVEL_CONTROL_CTX | ( | lev_ctrl_ctx, | |
lev_ctrl_count | |||
) | zb_zcl_cvc_alarm_variables_t lev_ctrl_ctx[lev_ctrl_count] |
Declare device level control context
lev_ctrl_ctx | - level control context variable name |
lev_ctrl_count | - number of level control attributes |
#define ZBOSS_DEVICE_DECLARE_REPORTING_CTX | ( | rep_ctx, | |
rep_count | |||
) | zb_zcl_reporting_info_t rep_ctx[rep_count] |
Declare device reporting context
rep_ctx | - reporting context variable name |
rep_count | - number of reporting attributes |
AF command transmission statuses
typedef struct zb_af_endpoint_desc_s zb_af_endpoint_desc_t |
Endpoint descriptor.
Endpoint description for user applications.
typedef struct zb_af_node_desc_s zb_af_node_desc_t |
Node descriptor
typedef struct zb_af_node_power_desc_s zb_af_node_power_desc_t |
Node power descriptor
typedef struct zb_af_simple_desc_1_1_s zb_af_simple_desc_1_1_t |
General descriptor type
typedef struct zb_af_simple_desc_8_9_s zb_af_simple_desc_8_9_t |
ZDO descriptor type
typedef void(* zb_af_transmission_res_cb_t)(zb_uint8_t status) |
Callback for notifying user about status of ZCL/ZDO command transmission
typedef enum zb_current_power_mode_e zb_current_power_mode_t |
Power descriptor types
typedef zb_uint8_t(* zb_device_handler_t)(zb_uint8_t param) |
Device command handler
param | - index of buffer with ZCL command |
typedef enum zb_power_source_level_e zb_power_source_level_t |
Power source level values
typedef enum zb_power_src_e zb_power_src_t |
Power source type
enum zb_af_profile_id_e |
Profile identifiers
Power descriptor types
enum zb_desc_capability_e |
enum zb_freq_band_e |
enum zb_power_src_e |
enum zb_server_mask_bit_e |
Node descriptor - server mask
zb_af_endpoint_desc_t* zb_af_get_endpoint_desc | ( | zb_uint8_t | ep_id | ) |
Search for endpoint (device) descriptor by endpoint ID.
ep_id | - identifier of the endpoint. |
void zb_af_set_data_indication | ( | zb_device_handler_t | cb | ) |
Set up application callback to be called for APS data packets.
That API call may be useful for tests which uses custom profile id or which needs to send raw data over APS.
cb | - callback to call when AF got APS packet. zb_apsde_data_indication_t |
void zb_bdb_reset_via_local_action | ( | zb_uint8_t | param | ) |
Perform "Reset with a Local Action" procedure (as described in BDB spec, chapter 9.5). The device will perform the NLME leave and clean all ZigBee persistent data except the outgoing NWK frame counter and application datasets (if any). The reset can be performed at any time once the device is started (see zboss_start). After the reset, the application will receive the ZB_ZDO_SIGNAL_LEAVE signal.
param | - buffer reference (if 0, buffer will be allocated automatically) |
void zb_set_default_ed_descriptor_values | ( | void | ) |
Set default descriptors values for end device.
void zb_set_default_ffd_descriptor_values | ( | zb_logical_type_t | device_type | ) |
Set default descriptors values for FFD.
device_type | - device type ZB_COORDINATOR or ZB_ROUTER |
See tp_zdo_bv_09, tp_zdo_bv-11 samples
void zb_set_input_cluster_id | ( | zb_af_simple_desc_1_1_t * | simple_desc, |
zb_uint8_t | cluster_number, | ||
zb_uint16_t | cluster_id | ||
) |
Set input cluster item
simple_desc | - pointer to simple descriptor |
cluster_number | - cluster item number |
cluster_id | - cluster id |
See tp_zdo_bv_09, tp_zdo_bv-11 samples
void zb_set_output_cluster_id | ( | zb_af_simple_desc_1_1_t * | simple_desc, |
zb_uint8_t | cluster_number, | ||
zb_uint16_t | cluster_id | ||
) |
Set output cluster item.
simple_desc | - pointer to simple descriptor |
cluster_number | - cluster item number |
cluster_id | - cluster id |
See tp_zdo_bv_09, tp_zdo_bv-11 samples
void zb_set_simple_descriptor | ( | zb_af_simple_desc_1_1_t * | simple_desc, |
zb_uint8_t | endpoint, | ||
zb_uint16_t | app_profile_id, | ||
zb_uint16_t | app_device_id, | ||
zb_bitfield_t | app_device_version, | ||
zb_uint8_t | app_input_cluster_count, | ||
zb_uint8_t | app_output_cluster_count | ||
) |
Set simple descriptor parameters
simple_desc | - pointer to simple descriptor |
endpoint | - Endpoint |
app_profile_id | - Application profile identifier |
app_device_id | - Application device identifier |
app_device_version | - Application device version |
app_input_cluster_count | - Application input cluster count |
app_output_cluster_count | - Application output cluster count |
See tp_zdo_bv_09, tp_zdo_bv-11 samples