Developing with ZBOSS for Zigbee
R23_allhubs

Data Structures

struct  zb_zdo_common_req_param_s
 
struct  zb_zdo_get_configuration_req_param_s
 ZDO Get Configuration Request parameters. More...
 
struct  zb_zdo_get_configuration_resp_param_s
 ZDO Get Configuration Response parameters. More...
 
struct  zb_zdo_configuration_parameters_s
 Configuration parameters Stack sends set_configuration_req to the device with set values. More...
 
struct  zb_zdo_next_panid_change_parameters_s
 Next PAN ID change parameters Stack sends set_configuration_req to the device with set values. More...
 
struct  zb_zdo_next_channel_change_parameters_s
 Next channel change parameters Stack sends set_configuration_req to the device with set values. More...
 
struct  zb_zdo_clear_all_bind_req_param_s
 Parameters for zdo_clear_all_bind_req. More...
 
struct  zb_zdo_mgmt_beacon_survey_param_s
 Parameters for beacon_survey_req command. More...
 
struct  zb_zcl_wwah_beacon_survey_s
 
struct  zb_zdo_beacon_survey_results_t
 R23, I.3.3 Beacon Survey Configuration TLV. More...
 
struct  zb_zdo_beacon_survey_potential_parents_t
 R23, I.3.5 Potential Parents TLV. More...
 
struct  zb_zdo_beacon_survey_resp_params_s
 Structure to store information when 'Beacon Survey' procedure is executing. More...
 

Macros

#define ZB_ZDO_CLEAR_ALL_BIND_EUI64_LIST_SIZE   (5u)
 
#define ZB_SURVEY_BEACON_MAX_CHANNEL_PAGE_CNT   10U
 
#define ZDO_WWAH_MAX_BEACON_SURVEY   5U
 
#define ZDO_WWAH_MAX_BEACON_SURVEY_BYTES
 

Typedefs

typedef struct zb_zdo_common_req_param_s zb_zdo_common_req_param_t
 
typedef struct zb_zdo_get_configuration_req_param_s zb_zdo_get_configuration_req_param_t
 ZDO Get Configuration Request parameters.
 
typedef struct zb_zdo_get_configuration_resp_param_s zb_zdo_get_configuration_resp_param_t
 ZDO Get Configuration Response parameters.
 
typedef struct zb_zdo_configuration_parameters_s zb_zdo_configuration_parameters_t
 Configuration parameters Stack sends set_configuration_req to the device with set values.
 
typedef struct zb_zdo_next_panid_change_parameters_s zb_zdo_next_panid_change_parameters_t
 Next PAN ID change parameters Stack sends set_configuration_req to the device with set values.
 
typedef struct zb_zdo_next_channel_change_parameters_s zb_zdo_next_channel_change_parameters_t
 Next channel change parameters Stack sends set_configuration_req to the device with set values.
 
typedef struct zb_zdo_clear_all_bind_req_param_s zb_zdo_clear_all_bind_req_param_t
 Parameters for zdo_clear_all_bind_req.
 
typedef zb_zdo_clear_all_bind_req_param_t zb_zdo_decommission_req_param_t
 
typedef struct zb_zdo_mgmt_beacon_survey_param_s zb_zdo_mgmt_beacon_survey_param_t
 Parameters for beacon_survey_req command.
 
typedef struct zb_zcl_wwah_beacon_survey_s zb_zcl_wwah_beacon_survey_t
 
typedef zb_zcl_wwah_beacon_survey_t zb_zdo_beacon_survey_parent_info_t
 
typedef struct zb_zdo_beacon_survey_results_t zb_zdo_beacon_survey_results_t
 R23, I.3.3 Beacon Survey Configuration TLV. More...
 
typedef struct zb_zdo_beacon_survey_potential_parents_t zb_zdo_beacon_survey_potential_parents_t
 R23, I.3.5 Potential Parents TLV. More...
 
typedef struct zb_zdo_beacon_survey_resp_params_s zb_zdo_beacon_survey_resp_params_t
 Structure to store information when 'Beacon Survey' procedure is executing. More...
 

Functions

void zb_set_tc_connectivity (zb_bool_t val)
 
zb_bool_t zb_get_tc_connectivity (void)
 
void zb_set_nwk_preferred_parent (zb_bool_t val)
 
zb_uint8_t zb_zdo_send_configuration_parameters (zb_uint8_t param, zb_callback_t cb)
 Sends secur_set_configuration_req command with configuration parameters. More...
 
zb_uint8_t zb_zdo_send_next_panid_change (zb_uint8_t param, zb_callback_t cb)
 Sends secur_set_configuration_req command with next pan id change information. More...
 
zb_uint8_t zb_zdo_send_next_channel_change (zb_uint8_t param, zb_callback_t cb)
 Sends secur_set_configuration_req command with next channel change information. More...
 
zb_uint8_t zb_zdo_get_configuration_req (zb_uint8_t param, zb_callback_t cb)
 Sends Secur_Get_Configuration_req command. More...
 
zb_uint8_tzdo_fill_get_configuration_req (zb_uint8_t param, zb_uint16_t dst, zb_uint8_t tlv_count, zb_uint8_t first_tlv_id)
 Start filling of body of ZDO Secur Get Configuration Req. More...
 
zb_uint8_t zb_zdo_decommission_req (zb_uint8_t param, zb_callback_t cb)
 Sends Secur_Decommission_req command. More...
 
zb_uint8_t zdo_mgmt_beacon_survey_req (zb_uint8_t param, zb_callback_t cb)
 Sends Mgmt beacon survey request. More...
 

Detailed Description

Macro Definition Documentation

◆ ZB_SURVEY_BEACON_MAX_CHANNEL_PAGE_CNT

#define ZB_SURVEY_BEACON_MAX_CHANNEL_PAGE_CNT   10U

Max number of channels to process at a single beacon survey command

◆ ZB_ZDO_CLEAR_ALL_BIND_EUI64_LIST_SIZE

#define ZB_ZDO_CLEAR_ALL_BIND_EUI64_LIST_SIZE   (5u)

Max size of eui64_list. No more than 5 entry are placed in the ZB packet

◆ ZDO_WWAH_MAX_BEACON_SURVEY_BYTES

#define ZDO_WWAH_MAX_BEACON_SURVEY_BYTES
Value:
* (ZDO_WWAH_MAX_BEACON_SURVEY)) \

Typedef Documentation

◆ zb_zcl_wwah_beacon_survey_t

Beacon survey result for a single potential parent. Common deniminator for r23 and WWAH.

◆ zb_zdo_beacon_survey_potential_parents_t

R23, I.3.5 Potential Parents TLV.

This TLV is 3 to 13 bytes in length and indicates the number of available parents in radio range. A maximum number of 5 parents is supported for this TLV. The list of potential parents SHALL be ordered as described in 3.6.1.3.2.

◆ zb_zdo_beacon_survey_resp_params_t

Structure to store information when 'Beacon Survey' procedure is executing.

We reuse a buffer which contain 'Beacon Survey Request' command and store all necessary information into it. Format of the 'Beacon Survey Response' command is different between ZCL WWAH and r23, so we need to use two functions to parse results and send response

◆ zb_zdo_beacon_survey_results_t

R23, I.3.3 Beacon Survey Configuration TLV.

This TLV is 5-bytes in length and contains information about the channels and scan configuration that is used when performing a beacon survey.

R23, I.3.4 Beacon Survey Results TLV

This TLV is 4-bytes in length and contains information about the channels, scan configuration, and counted devices or beacons.

◆ zb_zdo_common_req_param_t

Parameter for number of r23 ZDO commands

◆ zb_zdo_decommission_req_param_t

Parameter for ZDO Secur_Decommission_req

Function Documentation

◆ zb_get_tc_connectivity()

zb_bool_t zb_get_tc_connectivity ( void  )

Get current value of the TC connectivity flag.

Returns
if ZB_TRUE, that ZR has TC connectivity

◆ zb_set_nwk_preferred_parent()

void zb_set_nwk_preferred_parent ( zb_bool_t  val)

Public API to set nwk_preferred_parent to val

◆ zb_set_tc_connectivity()

void zb_set_tc_connectivity ( zb_bool_t  val)

Overwrite the auto-detected TC connectivity flag.

That flag is related to All Hubs feature and WWAH. Note: applicable for ZRs only.

Parameters
val- if ZB_TRUE, that ZR has TC connectivity

◆ zb_zdo_decommission_req()

zb_uint8_t zb_zdo_decommission_req ( zb_uint8_t  param,
zb_callback_t  cb 
)

Sends Secur_Decommission_req command.

Parameters
param- index of buffer with request zb_zdo_decommission_req_param_t
cb- user's function to call when got response from the remote.
Returns
ZDP transaction sequence number or
0xFF if operation cannot be performed now (nor enough memory, resources, etc.)
static void app_send_decommission_req(zb_uint8_t param)
{
TRACE_MSG(TRACE_APP1, "app_send_decommission_req, param %hd", (FMT__H, param));
/* clear buffer */
(void)zb_buf_initial_alloc(param, 0);
req_param->dst_addr = zb_address_short_by_ieee(g_r23_zr_ieee_addr);
req_param->eui64_count = 1;
ZB_IEEE_ADDR_COPY(req_param->eui64_list[0], g_r22_zr_ieee_addr);
/* zb_zdo_clear_all_bind_req() can be used instead of zb_zdo_decommission_req().
* Both of these requests clear the bindings, but the ZDO Decommission request
* also clears partner link keys for selected devices */
if (zb_zdo_decommission_req(param, app_send_mgmt_bind_req2) == 0xffu)
{
zb_buf_free(param);
TRACE_MSG(TRACE_ERROR, "unexpected error", (FMT__0));
ZB_ASSERT(0);
}
}

◆ zb_zdo_get_configuration_req()

zb_uint8_t zb_zdo_get_configuration_req ( zb_uint8_t  param,
zb_callback_t  cb 
)

Sends Secur_Get_Configuration_req command.

Parameters
param- index of buffer with request
cb- user's function to call when got response from the remote.
Returns
ZDP transaction sequence number or
0xFF if operation cannot be performed now (nor enough memory, resources, etc.)

◆ zb_zdo_send_configuration_parameters()

zb_uint8_t zb_zdo_send_configuration_parameters ( zb_uint8_t  param,
zb_callback_t  cb 
)

Sends secur_set_configuration_req command with configuration parameters.

That API can be called in centralized network only at TC; in distributed network - at any device.

Parameters
param- index of buffer with request zb_zdo_configuration_parameters_s
cb- user's function to call when got response from the remote
Returns
ZDP transaction sequence number or
0xFF if operation cannot be performed now (nor enough memory, resources, etc.)
/* Functions for demonstrate the set configuration request API */
static void app_send_configuration_req_cb(zb_uint8_t param)
{
TRACE_MSG(TRACE_APP1, "app_send_configuration_req_cb, param %hd, tsn %hd, status %hd",
(FMT__H_H_H, param, resp->tsn, resp->status));
ZB_SCHEDULE_APP_CALLBACK(app_do_next_test_step, param);
}
static void app_send_configuration_req(zb_uint8_t param, zb_uint16_t short_addr)
{
TRACE_MSG(TRACE_APP1, "app_send_configuration_req, param %hd, short_addr 0x%x",
(FMT__H_D, param, short_addr));
req_param->dst_addr = short_addr;
req_param->restricted_mode_enabled = 1u; /* Certain ZDO commands will not be accepted unless sent
by Trust Center with APS encryption */
req_param->require_link_key_encr_for_tk = 1u; /* Device will require that the APS Transport key command
shall be APS encrypted with the device's unique Trust Center Link Key */
req_param->leave_req_allowed = 1u;
req_param->disable_channel_change = 1u; /* Forbid channel change for device */
req_param->disable_panid_change = 1u; /* Forbid pan id change for device */
(void)zb_zdo_send_configuration_parameters(param, app_send_configuration_req_cb);
}

◆ zb_zdo_send_next_channel_change()

zb_uint8_t zb_zdo_send_next_channel_change ( zb_uint8_t  param,
zb_callback_t  cb 
)

Sends secur_set_configuration_req command with next channel change information.

Parameters
param- index of buffer with request zb_zdo_next_channel_change_parameters_s
cb- user's function to call when got response from the remote.
Returns
ZDP transaction sequence number or
0xFF if operation cannot be performed now (nor enough memory, resources, etc.)

◆ zb_zdo_send_next_panid_change()

zb_uint8_t zb_zdo_send_next_panid_change ( zb_uint8_t  param,
zb_callback_t  cb 
)

Sends secur_set_configuration_req command with next pan id change information.

Parameters
param- index of buffer with request zb_zdo_next_panid_change_parameters_s
cb- user's function to call when got response from the remote.
Returns
ZDP transaction sequence number or
0xFF if operation cannot be performed now (nor enough memory, resources, etc.)

◆ zdo_fill_get_configuration_req()

zb_uint8_t* zdo_fill_get_configuration_req ( zb_uint8_t  param,
zb_uint16_t  dst,
zb_uint8_t  tlv_count,
zb_uint8_t  first_tlv_id 
)

Start filling of body of ZDO Secur Get Configuration Req.

If ZDO Secur Get Configuration Req queries about just one tlv, call to that function is enough. If it queries about > 1 tlv, continue filling using returned ptr.

Parameters
param- output buffer
dst- destination address
tlv_count- count of tlvs in the request
first_tlv_id- id of the first tlv id
Returns
pointer to the rest of tlv ids (to be filled by the caller).

◆ zdo_mgmt_beacon_survey_req()

zb_uint8_t zdo_mgmt_beacon_survey_req ( zb_uint8_t  param,
zb_callback_t  cb 
)

Sends Mgmt beacon survey request.

Parameters
param- buffer holding in parameters section zb_zdo_mgmt_beacon_survey_param_t
cb- callback to be called on ZDO command complete. Survey result is in data section of param of type zb_zdo_beacon_survey_resp_params_t
/*
* Functions for demonstrate Beacon Survey
*/
static void app_beacon_survey_cb(zb_uint8_t param)
{
zb_uindex_t i;
TRACE_MSG(TRACE_APP1, ">> app_beacon_survey_cb param %hd status %hd panid_conflict_count %hd",
(FMT__H_H_H, param, resp->status, resp->panid_conflict_count));
TRACE_MSG(TRACE_APP1, "survey results: total_beacons_surveyed %hd num_cur_nwk_beacons %hd num_potential_parents_current_zbn %hd num_other_nwk_beacons %hd",
(FMT__H_H_H_H,
resp->results.total_beacons_surveyed,
resp->results.num_cur_nwk_beacons,
resp->results.num_other_nwk_beacons));
TRACE_MSG(TRACE_APP1, "current_parent 0x%x, lqa %hd parents_count %hd",
for (i = 0 ; i < resp->parents.count_potential_parents ; ++i)
{
TRACE_MSG(TRACE_APP1, "potential parent 0x%x, lqa %hd",
(FMT__D_H, resp->parents.parent_list[i].device_short, resp->parents.parent_list[i].lqi));
}
ZB_SCHEDULE_APP_CALLBACK(app_do_next_test_step, param);
TRACE_MSG(TRACE_APP1, "<< app_beacon_survey_cb", (FMT__0));
}
static void app_send_beacon_survey(zb_uint8_t param, zb_uint16_t short_addr)
{
TRACE_MSG(TRACE_APP1, ">> app_send_beacon_survey_req, param %hd, short_addr 0x%x",
(FMT__H_D, param, short_addr));
req_param->channel_page_cnt = ZB_SURVEY_BEACON_MAX_CHANNEL_PAGE_CNT;
req_param->dst_addr = short_addr;
zb_channel_page_list_get_page_idx(APPLICATION_CHANNEL_PAGE, &idx);
ZB_BZERO(req_param->channel_page_list, sizeof(zb_uint32_t) * ZB_SURVEY_BEACON_MAX_CHANNEL_PAGE_CNT);
ZB_CHANNEL_PAGE_SET_PAGE(req_param->channel_page_list[idx], APPLICATION_CHANNEL_PAGE);
ZB_CHANNEL_PAGE_SET_MASK(req_param->channel_page_list[idx], APPLICATION_CHANNEL_MASK);
req_param->config_mask = 0x00;
zdo_mgmt_beacon_survey_req(param, app_beacon_survey_cb);
TRACE_MSG(TRACE_APP1, "<< app_send_beacon_survey_req", (FMT__0));
}
zb_zdo_beacon_survey_potential_parents_t::current_parent_lqa
zb_uint8_t current_parent_lqa
Definition: zboss_api_zdo.h:4062
zb_zdo_beacon_survey_resp_params_s
Structure to store information when 'Beacon Survey' procedure is executing.
Definition: zboss_api_zdo.h:4079
zb_uint8_t
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:147
TRACE_MSG
#define TRACE_MSG(lm, fmts, args)
Put trace output.
Definition: zb_trace.h:369
zb_buf_initial_alloc
#define zb_buf_initial_alloc(buf, size)
Initial data space allocation in buffer.
Definition: zboss_api_buf.h:393
zb_zdo_beacon_survey_resp_params_s::status
zb_uint8_t status
Definition: zboss_api_zdo.h:4082
zb_zdo_mgmt_beacon_survey_param_s::dst_addr
zb_uint16_t dst_addr
Definition: zboss_api_zdo.h:3970
zb_zdo_clear_all_bind_req_param_s::eui64_list
zb_ieee_addr_t eui64_list[ZB_ZDO_CLEAR_ALL_BIND_EUI64_LIST_SIZE]
Definition: zboss_api_zdo.h:3856
zb_zcl_wwah_beacon_survey_s
Definition: zboss_api_zdo.h:3990
zb_zdo_clear_all_bind_req_param_s::eui64_count
zb_uint8_t eui64_count
Definition: zboss_api_zdo.h:3855
zb_zdo_set_configuration_resp_s::tsn
zb_uint8_t tsn
Definition: zboss_api_zdo.h:2788
zb_uint32_t
unsigned int zb_uint32_t
Project-local 4-byte unsigned int type.
Definition: zb_types.h:176
ZB_SCHEDULE_APP_CALLBACK
#define ZB_SCHEDULE_APP_CALLBACK(func, param)
Definition: zboss_api_core.h:319
ZB_BUF_GET_PARAM
#define ZB_BUF_GET_PARAM(buf, type)
Definition: zboss_api_buf.h:457
zb_zdo_configuration_parameters_s::leave_req_allowed
zb_bitfield_t leave_req_allowed
Definition: zboss_api_zdo.h:3805
zb_zdo_set_configuration_resp_s
Response by ZDO Set Configuration req.
Definition: zboss_api_zdo.h:2786
zb_zdo_clear_all_bind_req_param_s::dst_addr
zb_uint16_t dst_addr
Definition: zboss_api_zdo.h:3854
zb_zdo_beacon_survey_results_t::num_cur_nwk_beacons
zb_uint8_t num_cur_nwk_beacons
Definition: zboss_api_zdo.h:4040
ZB_SURVEY_BEACON_MAX_CHANNEL_PAGE_CNT
#define ZB_SURVEY_BEACON_MAX_CHANNEL_PAGE_CNT
Definition: zboss_api_zdo.h:3962
zb_zdo_configuration_parameters_s::disable_channel_change
zb_bitfield_t disable_channel_change
Definition: zboss_api_zdo.h:3807
zb_zdo_beacon_survey_potential_parents_t::count_potential_parents
zb_uint8_t count_potential_parents
Definition: zboss_api_zdo.h:4064
zb_zdo_beacon_survey_results_t::total_beacons_surveyed
zb_uint8_t total_beacons_surveyed
Definition: zboss_api_zdo.h:4037
zb_buf_begin
#define zb_buf_begin(buf)
Definition: zboss_api_buf.h:354
zb_zdo_configuration_parameters_s::disable_panid_change
zb_bitfield_t disable_panid_change
Definition: zboss_api_zdo.h:3810
zb_zdo_beacon_survey_results_t::num_potential_parents_current_zbn
zb_uint8_t num_potential_parents_current_zbn
Definition: zboss_api_zdo.h:4043
zb_address_short_by_ieee
zb_uint16_t zb_address_short_by_ieee(const zb_ieee_addr_t ieee_address)
zb_zdo_configuration_parameters_s::dst_addr
zb_uint16_t dst_addr
Definition: zboss_api_zdo.h:3797
zb_zdo_beacon_survey_resp_params_s::parents
zb_zdo_beacon_survey_potential_parents_t parents
Definition: zboss_api_zdo.h:4084
zb_zdo_set_configuration_resp_s::status
zb_uint8_t status
Definition: zboss_api_zdo.h:2789
zb_zdo_configuration_parameters_s
Configuration parameters Stack sends set_configuration_req to the device with set values.
Definition: zboss_api_zdo.h:3795
zb_uint16_t
unsigned short zb_uint16_t
Project-local 2-byte unsigned int type.
Definition: zb_types.h:151
zb_zdo_beacon_survey_potential_parents_t::current_parent
zb_uint16_t current_parent
Definition: zboss_api_zdo.h:4061
zb_buf_free
#define zb_buf_free(buf)
Free packet buffer and put it into free list.
Definition: zboss_api_buf.h:344
zdo_mgmt_beacon_survey_req
zb_uint8_t zdo_mgmt_beacon_survey_req(zb_uint8_t param, zb_callback_t cb)
Sends Mgmt beacon survey request.
zb_zdo_configuration_parameters_s::require_link_key_encr_for_tk
zb_bitfield_t require_link_key_encr_for_tk
Definition: zboss_api_zdo.h:3802
zb_zdo_decommission_req
zb_uint8_t zb_zdo_decommission_req(zb_uint8_t param, zb_callback_t cb)
Sends Secur_Decommission_req command.
zb_zdo_configuration_parameters_s::restricted_mode_enabled
zb_bitfield_t restricted_mode_enabled
Definition: zboss_api_zdo.h:3798
zb_zdo_mgmt_beacon_survey_param_s
Parameters for beacon_survey_req command.
Definition: zboss_api_zdo.h:3965
zb_zdo_send_configuration_parameters
zb_uint8_t zb_zdo_send_configuration_parameters(zb_uint8_t param, zb_callback_t cb)
Sends secur_set_configuration_req command with configuration parameters.
zb_zdo_clear_all_bind_req_param_s
Parameters for zdo_clear_all_bind_req.
Definition: zboss_api_zdo.h:3852