Developing with ZBOSS
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_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_bind_resp_s
 Response by BibdReq. 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 enum zb_bind_dst_addr_mode_e zb_bind_dst_addr_mode_t
 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 zb_bind_dst_addr_mode_e. Values 0x00, 0x02, 0x04-0xff are reserved. 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_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_bind_resp_s zb_zdo_bind_resp_t
 Response by BibdReq.
 
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...
 

Enumerations

enum  zb_bind_dst_addr_mode_e { ZB_BIND_DST_ADDR_MODE_16_BIT_GROUP = 0x01, ZB_BIND_DST_ADDR_MODE_64_BIT_EXTENDED = 0x03 }
 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 zb_bind_dst_addr_mode_e. Values 0x00, 0x02, 0x04-0xff are reserved. 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_bool_t zb_zdo_find_bind_src (zb_uint8_t src_end, zb_uint16_t cluster_id)
 Checks existence of bind table entries with selected endpoint and cluster ID. More...
 
zb_uint8_t zb_end_device_bind_req (zb_uint8_t param, zb_callback_t cb)
 

Detailed Description

Typedef Documentation

◆ zb_bind_dst_addr_mode_t

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 zb_bind_dst_addr_mode_e. Values 0x00, 0x02, 0x04-0xff are reserved.

See also
ZB Spec, subclause 2.4.3.2.2.

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

Enumeration Type Documentation

◆ zb_bind_dst_addr_mode_e

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 zb_bind_dst_addr_mode_e. Values 0x00, 0x02, 0x04-0xff are reserved.

See also
ZB Spec, subclause 2.4.3.2.2.
Enumerator
ZB_BIND_DST_ADDR_MODE_16_BIT_GROUP 

16-bit group address for DstAddress and DstEndp not present

ZB_BIND_DST_ADDR_MODE_64_BIT_EXTENDED 

64-bit extended address for DstAddress and DstEndp present

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_apsme_binding_req_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_MEMCPY(&req->src_addr, &g_ieee_addr, sizeof(zb_ieee_addr_t));
req->src_endpoint = i;
req->clusterid = 1;
ZB_MEMCPY(&req->dst_addr.addr_long, &g_ieee_addr_d, sizeof(zb_ieee_addr_t));
req->dst_endpoint = 240;
zb_zdo_bind_req(ZB_REF_FROM_BUF(buf), zb_bind_callback);
ret = buf->u.hdr.status;
if (ret == RET_TABLE_FULL)
{
TRACE_MSG(TRACE_ERROR, "TABLE FULL %d", (FMT__D, ret));
}
}
void zb_bind_callback(zb_uint8_t param)
{
zb_ret_t ret = RET_OK;
zb_bufid_t buf = (zb_bufid_t )ZB_BUF_FROM_REF(param);
zb_uint8_t *aps_body = NULL;
aps_body = zb_buf_begin(buf);
ZB_MEMCPY(&ret, aps_body, sizeof(ret));
TRACE_MSG(TRACE_INFO1, "zb_bind_callback %hd", (FMT__H, ret));
if (ret == RET_OK)
{
// bind ok
}
}

See tp_zdo_bv-12 sample

◆ zb_zdo_find_bind_src()

zb_bool_t zb_zdo_find_bind_src ( zb_uint8_t  src_end,
zb_uint16_t  cluster_id 
)

Checks existence of bind table entries with selected endpoint and cluster ID.

Parameters
src_end- source endpoint
cluster_id- source cluster ID
Returns
ZB_TRUE if binding is found on given endpoint, ZB_FALSE otherwise

◆ 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.)

See zdo_binding sample

◆ 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 = ZB_BUF_FROM_REF(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(param, 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);
}

See tp_aps_bv-23-i, tp_zdo_bv-12 samples

◆ 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