nRF5 SDK for Thread and Zigbee v3.2.0
Modules | Data Structures | Macros | Typedefs | Enumerations | Functions
AF functions visible to applications

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)
 

Enumerations

enum  zb_freq_band_e { ZB_FREQ_BAND_868 = 1, ZB_FREQ_BAND_902 = 1 << 2, ZB_FREQ_BAND_2400 = 1 << 3 }
 
enum  zb_server_mask_bit_e {
  ZB_PRIMARY_TRUST_CENTER = 1, ZB_BACKUP_TRUST_CENTER = 1 << 1, ZB_PRIMARY_BINDING_TABLE_CENTER = 1 << 2, ZB_BACKUP_BINDING_TABLE_CENTER = 1 << 3,
  ZB_PRIMARY_DISCOVERY_CACHE = 1 << 4, ZB_BACKUP_DISCOVERY_CACHE = 1 << 5, ZB_NETWORK_MANAGER = 1 << 6
}
 
enum  zb_desc_capability_e { ZB_EXT_ACTIVE_EP_LIST = 1, ZB_EXT_SIMPLE_DESC_LIST = 1 <<1 }
 
enum  zb_current_power_mode_e { ZB_POWER_MODE_SYNC_ON_WHEN_IDLE = 0, ZB_POWER_MODE_COME_ON_PERIODICALLY = 1, ZB_POWER_MODE_COME_ON_WHEN_STIMULATED = 2 }
 
enum  zb_power_src_e { ZB_POWER_SRC_CONSTATNT = 1, ZB_POWER_SRC_RECHARGEABLE_BATTERY = 1 << 1, ZB_POWER_SRC_DISPOSABLE_BATTERY = 1 << 2 }
 
enum  zb_power_source_level_e { ZB_POWER_LEVEL_CRITICAL = 0, ZB_POWER_LEVEL_33 = 4, ZB_POWER_LEVEL_66 = 8, ZB_POWER_LEVEL_100 = 12 }
 
enum  zb_af_profile_id_e {
  ZB_AF_ZDO_PROFILE_ID = 0x0000, ZB_AF_LEGACY_PROFILE1_ID = 0x0101, ZB_AF_LEGACY_PROFILE2_ID = 0x0102, ZB_AF_LEGACY_PROFILE3_ID = 0x0103,
  ZB_AF_HA_PROFILE_ID = 0x0104, ZB_AF_LEGACY_PROFILE4_ID = 0x0105, ZB_AF_LEGACY_PROFILE5_ID = 0x0106, ZB_AF_LEGACY_PROFILE6_ID = 0x0107,
  ZB_AF_LEGACY_PROFILE7_ID = 0x0108, ZB_AF_SE_PROFILE_ID = 0x0109, ZB_AF_ZLL_PROFILE_ID = 0xc05e, ZB_AF_WILDCARD_PROFILE_ID = 0xffff,
  ZB_AF_GP_PROFILE_ID = 0xA1E0
}
 
enum  zb_af_cmd_transmission_status_e { ZB_AF_STATUS_NO_FREE_BUF }
 

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_tzb_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...
 

Detailed Description

Macro Definition Documentation

#define ZB_AF_DECLARE_DEVICE_CTX (   device_ctx_name,
  ep_list_name,
  ep_count,
  reporting_attr_count 
)
Value:
zb_zcl_reporting_info_t reporting_info## device_ctx_name[reporting_attr_count]; \
zb_af_device_ctx_t device_ctx_name = \
{ \
ep_count, \
ep_list_name, \
reporting_attr_count, \
reporting_info## device_ctx_name, \
0, \
NULL \
}
#define ZB_AF_DECLARE_DEVICE_CTX_NO_REP (   device_ctx_name,
  ep_list_name,
  ep_count 
)
Value:
zb_af_device_ctx_t device_ctx_name = \
{ \
ep_count, \
ep_list_name, \
0, \
NULL, \
0, \
NULL \
}
#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 
)
Value:
{ \
ep_id, \
profile_id, \
NULL, \
NULL, \
reserved_length, \
(zb_voidp_t)reserved_ptr, \
cluster_number, \
cluster_list, \
simple_desc, \
rep_count, \
rep_ctx, \
lev_ctrl_count, \
lev_ctrl_ctx \
}
Endpoint descriptor.
Definition: zboss_api_af.h:331
void * zb_voidp_t
Project-local "pointer to void" type.
Definition: zb_types.h:294

Initialize endpoint descriptor.

Parameters
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.

Parameters
_ep- identifier of the endpoint under consideration.
Returns
ZB_TRUE if endpoint is registered, ZB_FALSE otherwise.
#define ZB_AF_REGISTER_DEVICE_CTX (   _device_ctx)    zb_af_register_device_ctx(_device_ctx)

Register device context.

Parameters
_device_ctx- Pointer to the device context

Example:

ZB_AF_REGISTER_DEVICE_CTX(&on_off_device_ctx);
#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.

Parameters
endpoint- Endpoint number
handler- Pointer to a function, function type zb_device_handler_t
Attention
Endpoint should be registered. ZB_AF_SET_ENDPOINT_HANDLER() should be called after device context is registered, using call to ZB_AF_REGISTER_DEVICE_CTX()

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

Parameters
endpointnumber
handlerto set
Attention
Assumes that endpoint already registered

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

Parameters
ep_list_name- name of ep list structure
#define ZB_DECLARE_SIMPLE_DESC (   in_clusters_count,
  out_clusters_count 
)
Value:
typedef ZB_PACKED_PRE struct zb_af_simple_desc_ ## in_clusters_count ## _ ## out_clusters_count ## _s \
{ \
zb_uint8_t endpoint; /* Endpoint */ \
zb_uint16_t app_profile_id; /* Application profile identifier */ \
zb_uint16_t app_device_id; /* Application device identifier */ \
zb_bitfield_t app_device_version:4; /* Application device version */ \
zb_bitfield_t reserved:4; /* Reserved */ \
zb_uint8_t app_input_cluster_count; /* Application input cluster count */ \
zb_uint8_t app_output_cluster_count; /* Application output cluster count */ \
/* Application input and output cluster list */ \
zb_uint16_t app_cluster_list[in_clusters_count + out_clusters_count]; \
} ZB_PACKED_STRUCT \
zb_af_simple_desc_ ## in_clusters_count ## _ ## out_clusters_count ## _t
unsigned short zb_uint16_t
Project-local 2-byte unsigned int type.
Definition: zb_types.h:120
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:116
zb_uint32_t zb_bitfield_t
Type to be used for unsigned bit fields inside structure.
Definition: zb_types.h:154

Declares Simple descriptor type

Parameters
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.

Parameters
func_ptr- a callback to set (of type zb_callback_t).

Example:

static void event_handler_cb(zb_uint8_t param)
{
zb_buf_t *buf = ZB_BUF_FROM_REF(param);
TRACE_MSG(TRACE_ZCL1, ">>event_handler_cb: buf_param = %d, device_cb_id = 0x%x",
(FMT__D_H, param, data->device_cb_id));
(data->cb_param.set_attr_value_param.cluster_id == ZB_ZCL_CLUSTER_ID_ON_OFF) &&
(data->cb_param.set_attr_value_param.attr_id == ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID) )
{
#ifdef USE_NVRAM_IN_TEST
#endif
}
TRACE_MSG(TRACE_ZCL1, "<<event_handler_cb", (FMT__0));
}
Register callback:
ZB_ZCL_REGISTER_DEVICE_CB(event_handler_cb);
#define ZBOSS_DECLARE_DEVICE_CTX (   device_ctx_name,
  ep_list_name,
  ep_count 
)
Value:
zb_af_device_ctx_t device_ctx_name = \
{ \
ep_count, \
ep_list_name, \
}

Declare application's device context

Parameters
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 
)
Value:
ZB_AF_START_DECLARE_ENDPOINT_LIST(ep_list_##device_ctx_name) \
&ep_name, \
ZBOSS_DECLARE_DEVICE_CTX(device_ctx_name, ep_list_##device_ctx_name, \
(ZB_ZCL_ARRAY_SIZE(ep_list_##device_ctx_name, zb_af_endpoint_desc_t*)))
Endpoint descriptor.
Definition: zboss_api_af.h:331
#define ZB_AF_FINISH_DECLARE_ENDPOINT_LIST
Definition: zboss_api_af.h:522
#define ZB_AF_START_DECLARE_ENDPOINT_LIST(ep_list_name)
Definition: zboss_api_af.h:396
#define ZBOSS_DECLARE_DEVICE_CTX(device_ctx_name, ep_list_name, ep_count)
Definition: zboss_api_af.h:596

Declare application's device context for single-endpoint device

Note
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.
Parameters
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 
)
Value:
ZB_AF_START_DECLARE_ENDPOINT_LIST(ep_list_##device_ctx_name) \
&ep1_name, \
&ep2_name, \
ZBOSS_DECLARE_DEVICE_CTX(device_ctx_name, ep_list_##device_ctx_name, \
(ZB_ZCL_ARRAY_SIZE(ep_list_##device_ctx_name, zb_af_endpoint_desc_t*)))
Endpoint descriptor.
Definition: zboss_api_af.h:331
#define ZB_AF_FINISH_DECLARE_ENDPOINT_LIST
Definition: zboss_api_af.h:522
#define ZB_AF_START_DECLARE_ENDPOINT_LIST(ep_list_name)
Definition: zboss_api_af.h:396
#define ZBOSS_DECLARE_DEVICE_CTX(device_ctx_name, ep_list_name, ep_count)
Definition: zboss_api_af.h:596

Declare application's device context for two-endpoint device

Note
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.
Parameters
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 
)
Value:
ZB_AF_START_DECLARE_ENDPOINT_LIST(ep_list_##device_ctx_name) \
&ep1_name, \
&ep2_name, \
&ep3_name, \
ZBOSS_DECLARE_DEVICE_CTX(device_ctx_name, ep_list_##device_ctx_name, \
(ZB_ZCL_ARRAY_SIZE(ep_list_##device_ctx_name, zb_af_endpoint_desc_t*)))
Endpoint descriptor.
Definition: zboss_api_af.h:331
#define ZB_AF_FINISH_DECLARE_ENDPOINT_LIST
Definition: zboss_api_af.h:522
#define ZB_AF_START_DECLARE_ENDPOINT_LIST(ep_list_name)
Definition: zboss_api_af.h:396
#define ZBOSS_DECLARE_DEVICE_CTX(device_ctx_name, ep_list_name, ep_count)
Definition: zboss_api_af.h:596

Declare application's device context for three-endpoint device

Note
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.
Parameters
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 
)
Value:
ZB_AF_START_DECLARE_ENDPOINT_LIST(ep_list_##device_ctx_name) \
&ep1_name, \
&ep2_name, \
&ep3_name, \
&ep4_name, \
ZBOSS_DECLARE_DEVICE_CTX(device_ctx_name, ep_list_##device_ctx_name, \
(ZB_ZCL_ARRAY_SIZE(ep_list_##device_ctx_name, zb_af_endpoint_desc_t*)))
Endpoint descriptor.
Definition: zboss_api_af.h:331
#define ZB_AF_FINISH_DECLARE_ENDPOINT_LIST
Definition: zboss_api_af.h:522
#define ZB_AF_START_DECLARE_ENDPOINT_LIST(ep_list_name)
Definition: zboss_api_af.h:396
#define ZBOSS_DECLARE_DEVICE_CTX(device_ctx_name, ep_list_name, ep_count)
Definition: zboss_api_af.h:596

Declare application's device context for for-endpoint device

Note
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.
Parameters
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

Parameters
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

Parameters
rep_ctx- reporting context variable name
rep_count- number of reporting attributes

Typedef Documentation

AF command transmission statuses

Endpoint descriptor.

Endpoint description for user applications.

Node descriptor

Node power descriptor

General descriptor type

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

Power descriptor types

typedef zb_uint8_t(* zb_device_handler_t)(zb_uint8_t param)

Device command handler

Parameters
param- index of buffer with ZCL command
Returns
status (see zb_bool_t)

Power source level values

Power source type

Enumeration Type Documentation

AF command transmission statuses

Enumerator
ZB_AF_STATUS_NO_FREE_BUF 

No free buffer

Profile identifiers

Enumerator
ZB_AF_ZDO_PROFILE_ID 

ZDO profile id

ZB_AF_LEGACY_PROFILE1_ID 

Legacy profile

ZB_AF_LEGACY_PROFILE2_ID 

Legacy profile

ZB_AF_LEGACY_PROFILE3_ID 

Legacy profile

ZB_AF_HA_PROFILE_ID 

HA profile id

ZB_AF_LEGACY_PROFILE4_ID 

Legacy profile

ZB_AF_LEGACY_PROFILE5_ID 

Legacy profile

ZB_AF_LEGACY_PROFILE6_ID 

Legacy profile

ZB_AF_LEGACY_PROFILE7_ID 

Legacy profile

ZB_AF_SE_PROFILE_ID 

SE profile id

ZB_AF_ZLL_PROFILE_ID 

ZLL profile identifier.

ZB_AF_WILDCARD_PROFILE_ID 

Wildcard profile identifier.

ZB_AF_GP_PROFILE_ID 

GreenPower profile id

Power descriptor types

Enumerator
ZB_POWER_MODE_SYNC_ON_WHEN_IDLE 

Receiver synchronized with the receiver on when idle subfield of the node descriptor.

ZB_POWER_MODE_COME_ON_PERIODICALLY 

Receiver comes on periodically as defined by the node power descriptor.

ZB_POWER_MODE_COME_ON_WHEN_STIMULATED 

Receiver comes on when stimulated, for example, by a user pressing a button.

Node descriptor - capability mask

Enumerator
ZB_EXT_ACTIVE_EP_LIST 

Extended Active Endpoint List Available

ZB_EXT_SIMPLE_DESC_LIST 

Extended Simple Descriptor List Available

Node descriptor - frequency value

Enumerator
ZB_FREQ_BAND_868 

868 MGz

ZB_FREQ_BAND_902 

902 MGz

ZB_FREQ_BAND_2400 

2400 MGz

Power source level values

Enumerator
ZB_POWER_LEVEL_CRITICAL 

Critical

ZB_POWER_LEVEL_33 

33%

ZB_POWER_LEVEL_66 

66%

ZB_POWER_LEVEL_100 

100%

Power source type

Enumerator
ZB_POWER_SRC_CONSTATNT 

Constant (mains) power

ZB_POWER_SRC_RECHARGEABLE_BATTERY 

Rechargeable battery

ZB_POWER_SRC_DISPOSABLE_BATTERY 

Disposable battery

Node descriptor - server mask

Enumerator
ZB_PRIMARY_TRUST_CENTER 

Primary Trust Center

ZB_BACKUP_TRUST_CENTER 

Backup Trust Center

ZB_PRIMARY_BINDING_TABLE_CENTER 

Primary Binding Table Center

ZB_BACKUP_BINDING_TABLE_CENTER 

Backup Binding Table Center

ZB_PRIMARY_DISCOVERY_CACHE 

Primary Discovery Cache

ZB_BACKUP_DISCOVERY_CACHE 

Backup Discovery Cache

ZB_NETWORK_MANAGER 

Network Manager

Function Documentation

zb_af_endpoint_desc_t* zb_af_get_endpoint_desc ( zb_uint8_t  ep_id)

Search for endpoint (device) descriptor by endpoint ID.

Parameters
ep_id- identifier of the endpoint.
Returns
NULL if no endpoint found, or pointer to the endpoint descriptor.
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.

Attention
Function is called on receive of APS data frame BEFORE internal processing. Please make sure that this callback does not handle packets on standard ZB profiles - this should be done by the stack.
Parameters
cb- callback to call when AF got APS packet. zb_apsde_data_indication_t
Returns
status (see zb_bool_t). ZB_TRUE means APS packet is processed by application (no further actions will be done by stack), ZB_FALSE means that application did not process the packet (stack will process it internally). Example:
{
if (ZB_GET_APP_SIGNAL_STATUS(param) == 0)
{
switch(sig)
{
TRACE_MSG(TRACE_APS1, "Device STARTED OK", (FMT__0));
zb_af_set_data_indication(data_indication);
break;
default:
TRACE_MSG(TRACE_APP1, "Unknown signal", (FMT__0));
break;
}
}
}
zb_uint8_t data_indication(zb_uint8_t param)
{
zb_uint8_t *ptr;
zb_buf_t *asdu = (zb_buf_t *)ZB_BUF_FROM_REF(param);
if (ind->profileid == TEST_CUSTOM_PROFILE_ID)
{
ptr = ZB_APS_HDR_CUT(asdu);
TRACE_MSG(TRACE_APS3, "apsde_data_indication: packet %p len %hd status 0x%hx from %d",
(FMT__P_D_D_D, asdu, ZB_BUF_LEN(asdu), asdu->u.hdr.status, ind->src_addr));
for (i = 0 ; i < ZB_BUF_LEN(asdu) ; ++i)
{
TRACE_MSG(TRACE_APS3, "%x %c", (FMT__D_C, (int)ptr[i], ptr[i]));
}
zb_free_buf(apsdu);
return ZB_TRUE;
}
return ZB_FALSE;
}
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.

Parameters
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.

Parameters
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

Parameters
simple_desc- pointer to simple descriptor
cluster_number- cluster item number
cluster_id- cluster id
Example
1 /* endpoint */, 0x0103 /* app_profile_id */,
0x0 /* app_device_id */, 0x0 /* app_device_version*/,
0xA /* app_input_cluster_count */, 0xA /* app_output_cluster_count */);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 0, 0x0);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 1, 0x3);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 2, 0x4);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 3, 0x38);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 4, 0x54);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 5, 0x70);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 6, 0x8c);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 7, 0xc4);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 8, 0xe0);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 9, 0xff);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 0, 0x0);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 1, 0x1);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 2, 0x2);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 3, 0x1c);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 4, 0x38);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 5, 0x70);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 6, 0x8c);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 7, 0xa8);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 8, 0xc4);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 9, 0xff);
zb_add_simple_descriptor((zb_af_simple_desc_1_1_t*)&test_simple_desc);

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.

Parameters
simple_desc- pointer to simple descriptor
cluster_number- cluster item number
cluster_id- cluster id
Example
1 /* endpoint */, 0x0103 /* app_profile_id */,
0x0 /* app_device_id */, 0x0 /* app_device_version*/,
0xA /* app_input_cluster_count */, 0xA /* app_output_cluster_count */);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 0, 0x0);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 1, 0x3);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 2, 0x4);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 3, 0x38);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 4, 0x54);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 5, 0x70);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 6, 0x8c);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 7, 0xc4);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 8, 0xe0);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 9, 0xff);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 0, 0x0);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 1, 0x1);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 2, 0x2);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 3, 0x1c);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 4, 0x38);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 5, 0x70);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 6, 0x8c);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 7, 0xa8);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 8, 0xc4);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 9, 0xff);
zb_add_simple_descriptor((zb_af_simple_desc_1_1_t*)&test_simple_desc);

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

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
Example
1 /* endpoint */, 0x0103 /* app_profile_id */,
0x0 /* app_device_id */, 0x0 /* app_device_version*/,
0xA /* app_input_cluster_count */, 0xA /* app_output_cluster_count */);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 0, 0x0);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 1, 0x3);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 2, 0x4);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 3, 0x38);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 4, 0x54);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 5, 0x70);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 6, 0x8c);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 7, 0xc4);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 8, 0xe0);
zb_set_input_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 9, 0xff);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 0, 0x0);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 1, 0x1);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 2, 0x2);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 3, 0x1c);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 4, 0x38);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 5, 0x70);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 6, 0x8c);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 7, 0xa8);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 8, 0xc4);
zb_set_output_cluster_id((zb_af_simple_desc_1_1_t*)&test_simple_desc, 9, 0xff);
zb_add_simple_descriptor((zb_af_simple_desc_1_1_t*)&test_simple_desc);

See tp_zdo_bv_09, tp_zdo_bv-11 samples


Documentation feedback | Developer Zone | Subscribe | Updated