Developing with ZBOSS for Zigbee

Data Structures

struct  zb_channel_panid_change_preparation_s
 Callback parameters for zb_prepare_network_for_channel_change() and zb_prepare_network_for_panid_change() Stack sends set_configuration_req to the all devices and count responses with incorrect status. More...
 
struct  zb_channel_change_parameters_s
 Parameters for zb_prepare_network_for_channel_change() and zb_start_channel_change() More...
 
struct  zb_panid_change_parameters_s
 Parameters for zb_prepare_network_for_panid_change() and zb_start_panid_change() More...
 

Typedefs

typedef struct zb_channel_panid_change_preparation_s zb_channel_panid_change_preparation_t
 Callback parameters for zb_prepare_network_for_channel_change() and zb_prepare_network_for_panid_change() Stack sends set_configuration_req to the all devices and count responses with incorrect status.
 
typedef struct zb_channel_change_parameters_s zb_channel_change_parameters_t
 Parameters for zb_prepare_network_for_channel_change() and zb_start_channel_change()
 
typedef struct zb_panid_change_parameters_s zb_panid_change_parameters_t
 Parameters for zb_prepare_network_for_panid_change() and zb_start_panid_change()
 

Functions

zb_ret_t zb_prepare_network_for_channel_change (zb_uint8_t param, zb_callback_t cb)
 
zb_ret_t zb_prepare_network_for_panid_change (zb_uint8_t param, zb_callback_t cb)
 
zb_ret_t zb_start_channel_change (zb_uint8_t param)
 
zb_ret_t zb_start_panid_change (zb_uint8_t param)
 
void zb_enable_panid_conflict_resolution (zb_bool_t status)
 
void zb_enable_auto_pan_id_conflict_resolution (zb_bool_t status)
 

Detailed Description

Function Documentation

◆ zb_enable_auto_pan_id_conflict_resolution()

void zb_enable_auto_pan_id_conflict_resolution ( zb_bool_t  status)

Toggles automatic panid conflict resolution.

Deprecated:
Enabling/disabling of automatic panid conflict resolution is deprecated in r23 codebase and does nothing.

Call of that function allows switching on/off automatic panid conflict resolution.

Parameters
status- if ZB_TRUE, enable conflict resolution, else disable

◆ zb_enable_panid_conflict_resolution()

void zb_enable_panid_conflict_resolution ( zb_bool_t  status)

Toggles panid conflict resolution.

Deprecated:
Enabling/disabling of panid conflict resolution is deprecated in r23 codebase snd does nothing.

Call of that function allows switching on/off panid conflict resolution and detection logic.

Deprecated:
Kept only for backward compatibility. PANID conflict detection is always enabled at R23 and can not be disabled. Application is responsible for starting of conflict resolution.
Parameters
status- if ZB_TRUE, enable conflict resolution, else disable

◆ zb_prepare_network_for_channel_change()

zb_ret_t zb_prepare_network_for_channel_change ( zb_uint8_t  param,
zb_callback_t  cb 
)

This function set nwkNextChannelChange and sends set_configuration_req for all remote devices. Parameters zb_channel_change_parameters_t will be using for zb_start_channel_change()

Parameters
param- buffer with parameters zb_channel_change_parameters_t
cb- callback function, zb_channel_panid_change_preparation_t
/*
* Functions for demonstrate active channel change
*/
static void app_nwk_mgmt_change_channel_cb(zb_uint8_t param)
{
TRACE_MSG(TRACE_APP1, ">> app_nwk_mgmt_change_channel_cb, param, error cnt = %d", (FMT__D, params->error_cnt));
if (params->error_cnt == 0)
{
TRACE_MSG(TRACE_APP1, "Preparation for channel change is successful, let's send channel change command", (FMT__0));
{
TRACE_MSG(TRACE_APP1, "Change channel procedure started successful", (FMT__0));
ZB_SCHEDULE_APP_ALARM(app_do_next_test_step, 0, ZB_TIME_ONE_SECOND * 10u);
}
}
TRACE_MSG(TRACE_APP1, "<< app_nwk_mgmt_change_channel_cb", (FMT__0));
}
static void app_nwk_mgmt_change_channel(zb_uint8_t param, zb_channel_page_t channel_mask)
{
params->next_channel_change = channel_mask;
/* Send set_configuration_req to all devices for allow channel change */
if (RET_OK == zb_prepare_network_for_channel_change(param, app_nwk_mgmt_change_channel_cb))
{
TRACE_MSG(TRACE_APP1, "Prepare network for channel change, next channel mask: 0x%x", (FMT__D, channel_mask));
}
}

◆ zb_prepare_network_for_panid_change()

zb_ret_t zb_prepare_network_for_panid_change ( zb_uint8_t  param,
zb_callback_t  cb 
)

This function set nwkNextPanId and sends set_configuration_req for all remote devices Parameters zb_panid_change_parameters_t will be using for zb_start_panid_change()

Parameters
param- buffer with parameters zb_panid_change_parameters_t
cb- callback function, zb_channel_panid_change_preparation_t
static void app_nwk_mgmt_change_panid_cb(zb_uint8_t param)
{
TRACE_MSG(TRACE_APP1, ">> app_nwk_mgmt_change_panid_cb, param, error cnt = %d", (FMT__D, params->error_cnt));
if (params->error_cnt == 0)
{
TRACE_MSG(TRACE_APP1, "Preparation for channel change is successful, let's send channel change command", (FMT__0));
{
TRACE_MSG(TRACE_APP1, "Change panid procedure started successful", (FMT__0));
/* Broadcast network key to decode packets in Wireshark after PAN ID change. Only for debugging */
ZB_SCHEDULE_APP_ALARM(app_broadcast_network_key, 0, 10 * ZB_TIME_ONE_SECOND);
}
}
TRACE_MSG(TRACE_APP1, "<< app_nwk_mgmt_change_panid_cb", (FMT__0));
}
static void app_nwk_mgmt_change_panid(zb_uint8_t param)
{
if (param == 0u)
{
zb_buf_get_out_delayed(app_nwk_mgmt_change_panid);
}
else
{
params->next_panid_change = 0xffffu; /* The next panid value will be randomly generated */
/* Send set_configuration_req to all devices for allow PAN ID change */
if (RET_OK == zb_prepare_network_for_panid_change(param, app_nwk_mgmt_change_panid_cb))
{
TRACE_MSG(TRACE_APP1, "Prepare network for panid change", (FMT__0));
}
}
}

◆ zb_start_channel_change()

zb_ret_t zb_start_channel_change ( zb_uint8_t  param)

Broadcast mgmt_nwk_update_req and change active channel for all devices in network. In centralized network the parameter zb_channel_change_parameters_t will be discarded

See also
zb_prepare_network_for_channel_change()
Parameters
param- buffer with parameters zb_channel_change_parameters_t
/*
* Functions for demonstrate active channel change
*/
static void app_nwk_mgmt_change_channel_cb(zb_uint8_t param)
{
TRACE_MSG(TRACE_APP1, ">> app_nwk_mgmt_change_channel_cb, param, error cnt = %d", (FMT__D, params->error_cnt));
if (params->error_cnt == 0)
{
TRACE_MSG(TRACE_APP1, "Preparation for channel change is successful, let's send channel change command", (FMT__0));
{
TRACE_MSG(TRACE_APP1, "Change channel procedure started successful", (FMT__0));
ZB_SCHEDULE_APP_ALARM(app_do_next_test_step, 0, ZB_TIME_ONE_SECOND * 10u);
}
}
TRACE_MSG(TRACE_APP1, "<< app_nwk_mgmt_change_channel_cb", (FMT__0));
}
static void app_nwk_mgmt_change_channel(zb_uint8_t param, zb_channel_page_t channel_mask)
{
params->next_channel_change = channel_mask;
/* Send set_configuration_req to all devices for allow channel change */
if (RET_OK == zb_prepare_network_for_channel_change(param, app_nwk_mgmt_change_channel_cb))
{
TRACE_MSG(TRACE_APP1, "Prepare network for channel change, next channel mask: 0x%x", (FMT__D, channel_mask));
}
}

◆ zb_start_panid_change()

zb_ret_t zb_start_panid_change ( zb_uint8_t  param)

Broadcast mgmt_nwk_update_req and change PAN ID for all devices in network. In centralized network the parameter zb_channel_change_parameters_t will be discarded

See also
zb_prepare_network_for_panid_change() This function can be used during pan id conflict resolutions, but R23 specification recommends to ignore the pan id conflicts
Parameters
param- buffer with parameters zb_panid_change_parameters_t
static void app_nwk_mgmt_change_panid_cb(zb_uint8_t param)
{
TRACE_MSG(TRACE_APP1, ">> app_nwk_mgmt_change_panid_cb, param, error cnt = %d", (FMT__D, params->error_cnt));
if (params->error_cnt == 0)
{
TRACE_MSG(TRACE_APP1, "Preparation for channel change is successful, let's send channel change command", (FMT__0));
{
TRACE_MSG(TRACE_APP1, "Change panid procedure started successful", (FMT__0));
/* Broadcast network key to decode packets in Wireshark after PAN ID change. Only for debugging */
ZB_SCHEDULE_APP_ALARM(app_broadcast_network_key, 0, 10 * ZB_TIME_ONE_SECOND);
}
}
TRACE_MSG(TRACE_APP1, "<< app_nwk_mgmt_change_panid_cb", (FMT__0));
}
static void app_nwk_mgmt_change_panid(zb_uint8_t param)
{
if (param == 0u)
{
zb_buf_get_out_delayed(app_nwk_mgmt_change_panid);
}
else
{
params->next_panid_change = 0xffffu; /* The next panid value will be randomly generated */
/* Send set_configuration_req to all devices for allow PAN ID change */
if (RET_OK == zb_prepare_network_for_panid_change(param, app_nwk_mgmt_change_panid_cb))
{
TRACE_MSG(TRACE_APP1, "Prepare network for panid change", (FMT__0));
}
}
}
zb_channel_panid_change_preparation_s::error_cnt
zb_uint16_t error_cnt
Definition: zboss_api_nwk.h:643
zb_panid_change_parameters_s::next_panid_change
zb_uint16_t next_panid_change
Definition: zboss_api_nwk.h:662
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_get_out_delayed
#define zb_buf_get_out_delayed(callback)
Allocate OUT buffer, call a callback when the buffer is available.
Definition: zboss_api_buf.h:275
zb_channel_change_parameters_s::next_channel_change
zb_uint32_t next_channel_change
Definition: zboss_api_nwk.h:652
ZB_BUF_GET_PARAM
#define ZB_BUF_GET_PARAM(buf, type)
Definition: zboss_api_buf.h:457
ZB_SCHEDULE_APP_ALARM
#define ZB_SCHEDULE_APP_ALARM(func, param, timeout_bi)
Definition: zboss_api_core.h:370
zb_start_channel_change
zb_ret_t zb_start_channel_change(zb_uint8_t param)
RET_OK
#define RET_OK
Error codes for non-void stack functions. In general, function can return OK, BLOCKED or some error....
Definition: zb_errors.h:79
zb_channel_change_parameters_s
Parameters for zb_prepare_network_for_channel_change() and zb_start_channel_change()
Definition: zboss_api_nwk.h:650
ZB_TIME_ONE_SECOND
#define ZB_TIME_ONE_SECOND
Definition: zboss_api_core.h:172
zb_prepare_network_for_panid_change
zb_ret_t zb_prepare_network_for_panid_change(zb_uint8_t param, zb_callback_t cb)
zb_prepare_network_for_channel_change
zb_ret_t zb_prepare_network_for_channel_change(zb_uint8_t param, zb_callback_t cb)
zb_panid_change_parameters_s
Parameters for zb_prepare_network_for_panid_change() and zb_start_panid_change()
Definition: zboss_api_nwk.h:660
zb_start_panid_change
zb_ret_t zb_start_panid_change(zb_uint8_t param)
zb_channel_panid_change_preparation_s
Callback parameters for zb_prepare_network_for_channel_change() and zb_prepare_network_for_panid_chan...
Definition: zboss_api_nwk.h:641