nRF5 SDK for Thread and Zigbee v1.0.0
Data Structures | Typedefs
Write attributes command sending and parsing.

Data Structures

struct  zb_zcl_write_attr_req_s
 ZCL Write Attribute Command frame. More...
 
struct  zb_zcl_write_attr_res_s
 ZCL Write Attribute Command frame. More...
 

Typedefs

typedef struct
zb_zcl_write_attr_req_s 
zb_zcl_write_attr_req_t
 ZCL Write Attribute Command frame. More...
 
typedef struct
zb_zcl_write_attr_res_s 
zb_zcl_write_attr_res_t
 ZCL Write Attribute Command frame. More...
 

Detailed Description

Both write attributes request and response commands have variable-length payload.

Write attributes request can be filled as following:

ZB_ZCL_GENERAL_INIT_WRITE_ATTR_REQ(data_buf, ptr, ZB_ZCL_ENABLE_DEFAULT_RESPONSE);
ZB_ZCL_GENERAL_ADD_VALUE_WRITE_ATTR_REQ(ptr, attr_id, attr_type, attr_val);
ZB_ZCL_GENERAL_SEND_WRITE_ATTR_REQ(
data_buf,
ptr,
dst_addr,
dst_ep,
src_ep,
NULL);

On the server side, this packet could be parsed in the following manner:

zb_zcl_write_attr_req_t *write_attr_req;
...
do
{
ZB_ZCL_GENERAL_GET_NEXT_WRITE_ATTR_REQ(data_buf, write_attr_req);
if (write_attr_req)
{
process write attribute request record
}
}
while(write_attr_req);

Response sending and parsing could be done in the same manner.

For more information see any HA sample

Typedef Documentation

ZCL Write Attribute Command frame.

See Also
ZCL spec, 2.4.3 Write Attributes Command

ZCL Write Attribute Command frame.

See Also
ZCL spec, 2.4.3 Write Attributes Command

Documentation feedback | Developer Zone | Subscribe | Updated