Developing with ZBOSS for Zigbee
ZDO binding management

Data Structures

struct  zb_zdo_mgmt_bind_param_s
 Parameters for Mgmt_Bind_req. More...
 
struct  zb_zdo_mgmt_bind_req_s
 Request for Mgmt_Bind_req. More...
 
struct  zb_zdo_mgmt_bind_resp_s
 Response for Mgmt_Bind_rsp. More...
 
struct  zb_zdo_binding_table_record_s
 BindingTableList Record Format for mgmt_bind_resp. See ZB spec, Table 2.131. More...
 
struct  zb_zdo_raw_req_param_s
 Parameters for zb_zdo_raw_req call. More...
 
struct  zb_zdo_raw_resp_param_s
 Parameters of zb_zdo_raw_resp call. More...
 
struct  zb_zdo_raw_resp_s
 Response by Raw_req. More...
 
struct  zb_zdo_bind_req_param_s
 Parameters for Bind_req API call. More...
 
struct  zb_zdo_bind_req_head_s
 Bind_req request head send to the remote. More...
 
struct  zb_zdo_bind_req_tail_1_s
 Bind_req request tail 1st variant send to the remote. More...
 
struct  zb_zdo_bind_req_tail_2_s
 Bind_req request tail 2nd variant send to the remote. More...
 
struct  zb_zdo_status_resp_s
 
struct  zb_zdo_bind_resp_s
 Response by Bind_req. More...
 
struct  zb_zdo_set_configuration_resp_s
 Response by ZDO Set Configuration req. More...
 
struct  zb_zdo_end_device_bind_req_head_s
 End_Device_Bind_req command head. More...
 
struct  zb_zdo_end_device_bind_req_tail_s
 End_Device_Bind_req command head. More...
 
struct  zb_end_device_bind_req_param_s
 Parameters for End_Device_Bind_req. More...
 
struct  zb_zdo_end_device_bind_resp_s
 Response from End_Device_Bind_req. More...
 

Typedefs

typedef zb_uint8_t zb_bind_dst_addr_mode_t
 Type for bind destination address mode. More...
 
typedef struct zb_zdo_mgmt_bind_param_s zb_zdo_mgmt_bind_param_t
 Parameters for Mgmt_Bind_req. More...
 
typedef struct zb_zdo_mgmt_bind_req_s zb_zdo_mgmt_bind_req_t
 Request for Mgmt_Bind_req. More...
 
typedef struct zb_zdo_mgmt_bind_resp_s zb_zdo_mgmt_bind_resp_t
 Response for Mgmt_Bind_rsp. More...
 
typedef struct zb_zdo_binding_table_record_s zb_zdo_binding_table_record_t
 BindingTableList Record Format for mgmt_bind_resp. See ZB spec, Table 2.131.
 
typedef struct zb_zdo_raw_req_param_s zb_zdo_raw_req_param_t
 Parameters for zb_zdo_raw_req call.
 
typedef struct zb_zdo_raw_resp_param_s zb_zdo_raw_resp_param_t
 Parameters of zb_zdo_raw_resp call.
 
typedef struct zb_zdo_raw_resp_s zb_zdo_raw_resp_t
 Response by Raw_req.
 
typedef struct zb_zdo_bind_req_param_s zb_zdo_bind_req_param_t
 Parameters for Bind_req API call. More...
 
typedef struct zb_zdo_bind_req_head_s zb_zdo_bind_req_head_t
 Bind_req request head send to the remote. More...
 
typedef struct zb_zdo_bind_req_tail_1_s zb_zdo_bind_req_tail_1_t
 Bind_req request tail 1st variant send to the remote. More...
 
typedef struct zb_zdo_bind_req_tail_2_s zb_zdo_bind_req_tail_2_t
 Bind_req request tail 2nd variant send to the remote. More...
 
typedef struct zb_zdo_status_resp_s zb_zdo_status_resp_t
 
typedef struct zb_zdo_bind_resp_s zb_zdo_bind_resp_t
 Response by Bind_req.
 
typedef struct zb_zdo_set_configuration_resp_s zb_zdo_set_configuration_resp_t
 Response by ZDO Set Configuration req.
 
typedef struct zb_zdo_end_device_bind_req_head_s zb_zdo_end_device_bind_req_head_t
 End_Device_Bind_req command head. More...
 
typedef struct zb_zdo_end_device_bind_req_tail_s zb_zdo_end_device_bind_req_tail_t
 End_Device_Bind_req command head. More...
 
typedef struct zb_end_device_bind_req_param_s zb_end_device_bind_req_param_t
 Parameters for End_Device_Bind_req. More...
 
typedef struct zb_zdo_end_device_bind_resp_s zb_zdo_end_device_bind_resp_t
 Response from End_Device_Bind_req. More...
 

Functions

zb_uint8_t zb_zdo_mgmt_bind_req (zb_uint8_t param, zb_callback_t cb)
 Sends Mgmt_Bind_req request. More...
 
void zdo_mgmt_bind_resp (zb_uint8_t param)
 Sends 2.4.4.3.4 Mgmt_Bind_rsp. More...
 
zb_uint8_t zb_zdo_bind_req (zb_uint8_t param, zb_callback_t cb)
 Bind_req request. More...
 
zb_uint8_t zb_zdo_unbind_req (zb_uint8_t param, zb_callback_t cb)
 Unbind_req request. More...
 
zb_uint8_t zb_zdo_clear_all_bind_req (zb_uint8_t param, zb_callback_t cb)
 
void zb_zdo_unbind_all_local (zb_uint8_t param)
 Perform unbind all entries locally. This custom function and it is not described in Zigbee specification. More...
 
void zb_zdo_check_binding_request (zb_bufid_t param)
 Checks if the binding with specified parameters exists. More...
 
zb_uint8_t zb_end_device_bind_req (zb_uint8_t param, zb_callback_t cb)
 

Bind destination address mode

The addressing mode for the destination address used in zb_zdo_binding_table_record_s, zb_zdo_bind_req_param_s, zb_zdo_bind_req_head_s command. This field can take one of the non-reserved values from the list of defines below (bind_dst_addr_mode). Values 0x00, 0x02, 0x04-0xff are reserved.

See also
ZB Spec, subclause 2.4.3.2.2.
#define ZB_BIND_DST_ADDR_MODE_16_BIT_GROUP   0x01U
 
#define ZB_BIND_DST_ADDR_MODE_64_BIT_EXTENDED   0x03U
 

Detailed Description

Macro Definition Documentation

◆ ZB_BIND_DST_ADDR_MODE_16_BIT_GROUP

#define ZB_BIND_DST_ADDR_MODE_16_BIT_GROUP   0x01U

16-bit group address for DstAddress and DstEndp not present

◆ ZB_BIND_DST_ADDR_MODE_64_BIT_EXTENDED

#define ZB_BIND_DST_ADDR_MODE_64_BIT_EXTENDED   0x03U

64-bit extended address for DstAddress and DstEndp present

Typedef Documentation

◆ zb_bind_dst_addr_mode_t

Type for bind destination address mode.

Deprecated:
holds one of bind_dst_addr_mode. Kept only for backward compatibility as bind_dst_addr_mode were declared previously as enum. Can be removed in future releases.

◆ zb_end_device_bind_req_param_t

Parameters for End_Device_Bind_req.

See also
ZB spec, subclause 2.4.3.2.1.

◆ zb_zdo_bind_req_head_t

Bind_req request head send to the remote.

See also
ZB spec, subclause 2.4.3.2.2.

◆ zb_zdo_bind_req_param_t

Parameters for Bind_req API call.

See also
ZB spec, subclause 2.4.3.2.2.

◆ zb_zdo_bind_req_tail_1_t

Bind_req request tail 1st variant send to the remote.

See also
ZB spec, subclause 2.4.3.2.2.

◆ zb_zdo_bind_req_tail_2_t

Bind_req request tail 2nd variant send to the remote.

See also
ZB spec, subclause 2.4.3.2.2.

◆ zb_zdo_end_device_bind_req_head_t

End_Device_Bind_req command head.

See also
ZB spec, subclause 2.4.3.2.1.

◆ zb_zdo_end_device_bind_req_tail_t

End_Device_Bind_req command head.

See also
ZB spec, subclause 2.4.3.2.1.

◆ zb_zdo_end_device_bind_resp_t

Response from End_Device_Bind_req.

See also
ZB spec, subclause 2.4.3.2.1.

◆ zb_zdo_mgmt_bind_param_t

Parameters for Mgmt_Bind_req.

See also
ZB spec, subclause 2.4.3.3.4.

◆ zb_zdo_mgmt_bind_req_t

Request for Mgmt_Bind_req.

See also
ZB spec, subclause 2.4.3.3.4.

◆ zb_zdo_mgmt_bind_resp_t

Response for Mgmt_Bind_rsp.

See also
ZB spec, subclause 2.4.4.3.4.

Function Documentation

◆ zb_end_device_bind_req()

zb_uint8_t zb_end_device_bind_req ( zb_uint8_t  param,
zb_callback_t  cb 
)

sends 2.4.3.2.1 End_Device_Bind_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_bind_req()

zb_uint8_t zb_zdo_bind_req ( zb_uint8_t  param,
zb_callback_t  cb 
)

Bind_req request.

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

Example:

void bind_device(zb_uint8_t param, zb_uint16_t dev_idx)
{
zb_bufid_t buf = param;
TRACE_MSG(TRACE_APP2, ">> bind_device param %hd", (FMT__H, param));
if (dev_idx != SIMPLE_GW_INVALID_DEV_INDEX)
{
ZB_MEMCPY(&req->src_address, g_device_ctx.devices[dev_idx].ieee_addr, sizeof(zb_ieee_addr_t));
req->src_endp = g_device_ctx.devices[dev_idx].endpoint;
req->dst_endp = SIMPLE_GW_ENDPOINT;
req->req_dst_addr = g_device_ctx.devices[dev_idx].short_addr;
zb_zdo_bind_req(param, bind_device_cb);
}
else
{
TRACE_MSG(TRACE_APP2, "No devices in binding configuration state were found!", (FMT__0));
}
TRACE_MSG(TRACE_APP2, "<< bind_device", (FMT__0));
}
void bind_device_cb(zb_uint8_t param)
{
zb_bufid_t buf = param;
if (bind_resp->status == ZB_ZDP_STATUS_SUCCESS)
{
zb_uint8_t dev_idx = simple_gw_get_dev_index_by_state(CONFIGURE_BINDING);
if (dev_idx != SIMPLE_GW_INVALID_DEV_INDEX)
{
g_device_ctx.devices[dev_idx].dev_state = CONFIGURE_REPORTING;
ZB_SCHEDULE_APP_CALLBACK2(configure_reporting, param, dev_idx);
param = 0;
}
}
if (param)
{
}
}

◆ zb_zdo_check_binding_request()

void zb_zdo_check_binding_request ( zb_bufid_t  param)

Checks if the binding with specified parameters exists.

◆ zb_zdo_clear_all_bind_req()

zb_uint8_t zb_zdo_clear_all_bind_req ( zb_uint8_t  param,
zb_callback_t  cb 
)

Execute ZDO Clear All Bindings for specified devices

Parameters
param- buffer holding zb_zdo_clear_all_bind_req_param_t in its params
cb- callback to be called on complete

◆ zb_zdo_mgmt_bind_req()

zb_uint8_t zb_zdo_mgmt_bind_req ( zb_uint8_t  param,
zb_callback_t  cb 
)

Sends Mgmt_Bind_req request.

Parameters
paramreference to the buffer to put request data to.
cbcallback to be called on operation finish.
Returns
ZDP transaction sequence number
0xFF if operation cannot be performed now (nor enough memory, resources, etc.)

◆ zb_zdo_unbind_all_local()

void zb_zdo_unbind_all_local ( zb_uint8_t  param)

Perform unbind all entries locally. This custom function and it is not described in Zigbee specification.

Parameters
param- not used.

◆ zb_zdo_unbind_req()

zb_uint8_t zb_zdo_unbind_req ( zb_uint8_t  param,
zb_callback_t  cb 
)

Unbind_req request.

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

Example:

{
zb_bufid_t buf = param;
TRACE_MSG(TRACE_COMMON1, "unbind_device_1", (FMT__0));
ZB_MEMCPY(bind_param->src_address, g_ieee_addr_ed1, sizeof(zb_ieee_addr_t));
bind_param->src_endp = TEST_ED1_EP;
bind_param->cluster_id = TP_BUFFER_TEST_REQUEST_CLID;
ZB_MEMCPY(bind_param->dst_address.addr_long, g_ieee_addr_ed2, sizeof(zb_ieee_addr_t));
bind_param->dst_endp = TEST_ED2_EP;
bind_param->req_dst_addr = zb_address_short_by_ieee(g_ieee_addr_ed1);
TRACE_MSG(TRACE_COMMON1, "dst addr %d", (FMT__D, bind_param->req_dst_addr));
zb_zdo_unbind_req(buf, unbind_device1_cb);
}
void unbind_device1_cb(zb_uint8_t param)
{
zb_bufid_t buf = ZB_BUF_FROM_REF(param);
TRACE_MSG(TRACE_COMMON1, "unbind_device1_cb resp status %hd", (FMT__H, bind_resp->status));
if (bind_resp->status != ZB_ZDP_STATUS_SUCCESS)
{
TRACE_MSG(TRACE_COMMON1, "Error bind device 1. Test status failed", (FMT__0));
}
zb_free_buf(buf);
}

◆ zdo_mgmt_bind_resp()

void zdo_mgmt_bind_resp ( zb_uint8_t  param)

Sends 2.4.4.3.4 Mgmt_Bind_rsp.

Parameters
param- index of buffer with Mgmt_Bind request
zb_zdo_bind_req_param_s::cluster_id
zb_uint16_t cluster_id
Definition: zboss_api_zdo.h:2716
zb_zdo_bind_req_param_s
Parameters for Bind_req API call.
Definition: zboss_api_zdo.h:2712
zb_uint8_t
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:147
ZB_SCHEDULE_APP_CALLBACK2
#define ZB_SCHEDULE_APP_CALLBACK2(func, param, user_param)
Definition: zboss_api_core.h:348
TRACE_MSG
#define TRACE_MSG(lm, fmts, args)
Put trace output.
Definition: zb_trace.h:369
ZB_ZCL_CLUSTER_ID_ON_OFF
#define ZB_ZCL_CLUSTER_ID_ON_OFF
Definition: zb_zcl_common.h:213
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_bind_req_param_s::req_dst_addr
zb_uint16_t req_dst_addr
Definition: zboss_api_zdo.h:2727
zb_zdo_bind_req_param_s::src_address
zb_ieee_addr_t src_address
Definition: zboss_api_zdo.h:2714
ZB_BUF_GET_PARAM
#define ZB_BUF_GET_PARAM(buf, type)
Definition: zboss_api_buf.h:457
zb_zdo_unbind_req
zb_uint8_t zb_zdo_unbind_req(zb_uint8_t param, zb_callback_t cb)
Unbind_req request.
zb_zdo_bind_req
zb_uint8_t zb_zdo_bind_req(zb_uint8_t param, zb_callback_t cb)
Bind_req request.
ZB_APS_ADDR_MODE_64_ENDP_PRESENT
#define ZB_APS_ADDR_MODE_64_ENDP_PRESENT
Definition: zboss_api_aps.h:108
zb_zdo_bind_req_param_s::dst_endp
zb_uint8_t dst_endp
Definition: zboss_api_zdo.h:2721
ZB_ZDP_STATUS_SUCCESS
#define ZB_ZDP_STATUS_SUCCESS
Definition: zboss_api_zdo.h:41
zb_buf_begin
#define zb_buf_begin(buf)
Definition: zboss_api_buf.h:354
zb_ieee_addr_t
zb_64bit_addr_t zb_ieee_addr_t
Long (64-bit) device address.
Definition: zb_types.h:535
zb_zdo_bind_resp_s::status
zb_uint8_t status
Definition: zboss_api_zdo.h:2781
zb_address_short_by_ieee
zb_uint16_t zb_address_short_by_ieee(const zb_ieee_addr_t ieee_address)
zb_zdo_bind_req_param_s::dst_address
zb_addr_u dst_address
Definition: zboss_api_zdo.h:2719
zb_zdo_bind_resp_s
Response by Bind_req.
Definition: zboss_api_zdo.h:2778
zb_uint16_t
unsigned short zb_uint16_t
Project-local 2-byte unsigned int type.
Definition: zb_types.h:151
zb_zdo_bind_req_param_s::dst_addr_mode
zb_uint8_t dst_addr_mode
Definition: zboss_api_zdo.h:2718
zb_buf_free
#define zb_buf_free(buf)
Free packet buffer and put it into free list.
Definition: zboss_api_buf.h:344
zb_bufid_t
zb_uint8_t zb_bufid_t
Definition: zboss_api_buf.h:178
zb_zdo_bind_req_param_s::src_endp
zb_uint8_t src_endp
Definition: zboss_api_zdo.h:2715
zb_get_long_address
void zb_get_long_address(zb_ieee_addr_t addr)