Developing with ZBOSS

Data Structures

struct  zb_apsme_binding_req_s
 APSME binding structure. More...
 
struct  zb_apsme_add_group_req_s
 APSME-ADD-GROUP.request primitive parameters. More...
 
struct  zb_apsme_add_group_conf_s
 APSME-ADD-GROUP.confirm primitive parameters. More...
 
struct  zb_apsme_remove_all_groups_req_s
 APSME-REMOVE-ALL-GROUPS.request primitive parameters. More...
 
struct  zb_apsme_remove_all_groups_conf_s
 APSME-REMOVE-ALL-GROUPS.confirm primitive parameters. More...
 

Typedefs

typedef struct zb_apsme_binding_req_s zb_apsme_binding_req_t
 APSME binding structure. More...
 
typedef struct zb_apsme_add_group_req_s zb_apsme_add_group_req_t
 APSME-ADD-GROUP.request primitive parameters.
 
typedef struct zb_apsme_add_group_conf_s zb_apsme_add_group_conf_t
 APSME-ADD-GROUP.confirm primitive parameters.
 
typedef struct zb_apsme_add_group_req_s zb_apsme_remove_group_req_t
 APSME-REMOVE-GROUP.request primitive parameters.
 
typedef struct zb_apsme_add_group_conf_s zb_apsme_remove_group_conf_t
 APSME-REMOVE-GROUP.confirm primitive parameters.
 
typedef struct zb_apsme_remove_all_groups_req_s zb_apsme_remove_all_groups_req_t
 APSME-REMOVE-ALL-GROUPS.request primitive parameters.
 
typedef struct zb_apsme_remove_all_groups_conf_s zb_apsme_remove_all_groups_conf_t
 APSME-REMOVE-ALL-GROUPS.confirm primitive parameters.
 

Functions

zb_uint8_t zb_aps_is_endpoint_in_group (zb_uint16_t group_id, zb_uint8_t endpoint)
 
void zb_apsme_bind_request (zb_uint8_t param)
 APSME-BIND.request primitive. More...
 
void zb_apsme_unbind_request (zb_uint8_t param)
 APSME-UNBIND.request primitive. More...
 
void zb_apsme_unbind_all (zb_uint8_t param)
 Perform unbind all entries. This custom function and it is not described in Zigbee specification. More...
 
void zb_apsme_add_group_request (zb_uint8_t param)
 APSME-ADD-GROUP.request primitive. More...
 
void zb_apsme_remove_group_request (zb_uint8_t param)
 APSME-REMOVE-GROUP.request primitive. More...
 
void zb_apsme_remove_all_groups_request (zb_uint8_t param)
 APSME-REMOVE-ALL-GROUPS.request primitive. More...
 

Detailed Description

Typedef Documentation

◆ zb_apsme_binding_req_t

APSME binding structure.

This data structure passed to zb_apsme_bind_request() and to zb_apsme_unbind_request().

Function Documentation

◆ zb_apsme_add_group_request()

void zb_apsme_add_group_request ( zb_uint8_t  param)

APSME-ADD-GROUP.request primitive.

Parameters
param- index of buffer with parameter. See zb_apsme_add_group_req_t.
Example
TRACE_MSG(TRACE_APP1, "> add_to_test_group buf %p", (FMT__P, buf));
ZB_BZERO(aps_req, sizeof(*aps_req));
aps_req->group_address = TEST_GROUP_ID;
aps_req->endpoint = HA_SWITCH_ENDPOINT;

See scenes sample

◆ zb_apsme_bind_request()

void zb_apsme_bind_request ( zb_uint8_t  param)

APSME-BIND.request primitive.

Parameters
param- index of buffer containing request data (see zb_apsme_binding_req_t).
Example
void light_control_bind_bulb(zb_uint8_t param)
{
TRACE_MSG(TRACE_APP2, ">> light_control_bind_bulb param %hd", (FMT__H, param));
bind_on_off_cluster(param);
TRACE_MSG(TRACE_APP2, "<< light_control_bind_bulb", (FMT__0));
}

See light_sample

◆ zb_apsme_remove_all_groups_request()

void zb_apsme_remove_all_groups_request ( zb_uint8_t  param)

APSME-REMOVE-ALL-GROUPS.request primitive.

Parameters
param- index of buffer with parameter. See zb_apsme_remove_all_groups_req_t.
Example
void remove_groups(zb_uint8_t param)
{
zb_buf_t *buf = ZB_BUF_FROM_REF(param);
zb_apsme_remove_all_groups_req_t *req_remove_param = NULL;
TRACE_MSG(TRACE_APP1, "> remove_groups param %hd", (FMT__H, param));
req_remove_param = ZB_GET_BUF_PARAM(buf, zb_apsme_remove_all_groups_req_t);
req_remove_param->endpoint = ZB_TEST_PROFILE_EP;
zb_free_buf(buf);
TRACE_MSG(TRACE_APP1, "< remove_groups", (FMT__0));
}

See tp_aps_bv-18 sample

◆ zb_apsme_remove_group_request()

void zb_apsme_remove_group_request ( zb_uint8_t  param)

APSME-REMOVE-GROUP.request primitive.

Parameters
param- index of buffer with parameter. See zb_apsme_remove_group_req_t.
Example
void remove_group(zb_uint8_t param)
{
zb_buf_t *buf = ZB_BUF_FROM_REF(param);
zb_apsme_remove_group_req_t *req_remove_param = NULL;
TRACE_MSG(TRACE_APP1, "> remove_group param %hd", (FMT__H, param));
req_remove_param = ZB_GET_BUF_PARAM(buf, zb_apsme_remove_group_req_t);
req_remove_param->endpoint = ZB_TEST_PROFILE_EP;
req_remove_param->group_address = 0x0001;
zb_free_buf(buf);
TRACE_MSG(TRACE_APP1, "< remove_group", (FMT__0));
}

See tp_aps_bv-17 sample

◆ zb_apsme_unbind_all()

void zb_apsme_unbind_all ( zb_uint8_t  param)

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

Parameters
param- not used.

◆ zb_apsme_unbind_request()

void zb_apsme_unbind_request ( zb_uint8_t  param)

APSME-UNBIND.request primitive.

Parameters
param- index of buffer containing request data (see zb_apsme_binding_req_t).
Example
TRACE_MSG(TRACE_APS1, "start APS unbind test", (FMT__0));
for (i = 1 ;(i < ZB_APS_SRC_BINDING_TABLE_SIZE || ret == RET_OK); ++i)
{
gen_64_bit_addr(ieee_addr, i+1, i+1);
ZB_MEMCPY(&req_b.src_addr, &ieee_addr, sizeof(zb_ieee_addr_t));
req_b.src_endpoint = i;
req_b.clusterid = 1;
gen_64_bit_addr(ieee_addr, i+2, i+2);
ZB_MEMCPY(&req_b.dst_addr.addr_long, &ieee_addr, sizeof(zb_ieee_addr_t));
req_b.dst_endpoint = i+1;
ZB_MEMCPY(
ZB_GET_BUF_TAIL(aps, sizeof(zb_apsme_binding_req_t)),
&req_b,
zb_apsme_unbind_request(ZB_REF_FROM_BUF(aps));
ret = aps->u.hdr.status;
}
if (ret)
{
if (ret == RET_INVALID_BINDING)
{
TRACE_MSG(TRACE_APS1, "invalid binding for i = %d ret %d", (FMT__D_D, i, ret));
if (ZG->aps.binding.src_n_elements == 1 && ZG->aps.binding.dst_n_elements == 1)
{
TRACE_MSG(TRACE_INFO2, "SUCCESS", (FMT__0));
}
else
{
TRACE_MSG(TRACE_APS1, "ERROR binding table is corrupted", (FMT__0));
}
}
else
{
TRACE_MSG(TRACE_APS1, "ERROR %d", (FMT__D, ret));
}
}

See aps_binding_test sample