nRF5 SDK for Thread and Zigbee v4.2.0
Data Structures | Macros | Typedefs
Report attribute command parsing

Data Structures

struct  zb_zcl_report_attr_req_s
 ZCL Report Attribute Command frame. More...


#define ZB_ZCL_GENERAL_GET_NEXT_REPORT_ATTR_REQ(data_buf, rep_attr_req)
 Parses Report attribute command and returns next Attribute report or NULL if there is no more data. More...


typedef struct
 ZCL Report Attribute Command frame. More...

Detailed Description

Report attributes command originates from ZCL internals as a packet constructed according to ZCL spec, subclause 2.4.11. This command can be parsed by cyclical application of ZB_ZCL_GENERAL_GET_NEXT_REPORT_ATTR_REQ() macro.

Macro Definition Documentation

{ \
zb_uint8_t req_size = 0xff; \
(rep_attr_req) = zb_buf_len(data_buf) >= ZB_ZCL_REPORT_ATTR_REQ_SIZE ? \
(zb_zcl_report_attr_req_t*)zb_buf_begin(data_buf) : NULL; \
if (rep_attr_req) \
{ \
ZB_ZCL_HTOLE16_INPLACE(&(rep_attr_req)->attr_id); \
/* Reduce req_size value by sizeof(zb_uint8_t) because it is \
* already included into zb_zcl_report_attr_req_t */ \
req_size += \
zb_zcl_get_attribute_size((rep_attr_req)->attr_type, (rep_attr_req)->attr_value) - \
sizeof(zb_uint8_t); \
if (req_size <= zb_buf_len(data_buf)) \
{ \
ZB_ZCL_FIX_ENDIAN((rep_attr_req)->attr_value, (rep_attr_req)->attr_type); \
} \
if (req_size <= zb_buf_len(data_buf)) \
{ \
(void)zb_buf_cut_left((data_buf), req_size); \
} \
else \
{ \
(rep_attr_req) = NULL; \
} \
} \
zb_uint8_t zb_zcl_get_attribute_size(zb_uint8_t attr_type, zb_uint8_t *attr_value)
Get size of value of given attribute type.
ZCL Report Attribute Command frame.
Definition: zb_zcl_commands.h:1655
#define zb_buf_cut_left(buf, size)
Definition: zboss_api_buf.h:483
#define zb_buf_begin(buf)
Definition: zboss_api_buf.h:362
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:155
#define zb_buf_len(buf)
Definition: zboss_api_buf.h:380
#define ZB_ZCL_FIX_ENDIAN(data_ptr, data_type)
Fix data endian, if needed, and store it in the same buffer.
Definition: zb_zcl_common.h:1903

Parses Report attribute command and returns next Attribute report or NULL if there is no more data.

If command contains invalid data, NULL is returned.

data_buf- ID zb_bufid_t of a buffer containing Report attribute command data
rep_attr_req- out pointer to zb_zcl_report_attr_req_t, containing Attribute report
data_buf buffer should contain Report attribute command payload, without ZCL header. Each parsed Attribute report attribute is extracted from initial data_buf buffer

Typedef Documentation

ZCL Report Attribute Command frame.

See also
ZCL spec, Report Attributes Command
Report attribute command contains variable number of attribute reports, zb_zcl_report_attr_req_t defines one attribute report

Documentation feedback | Developer Zone | Subscribe | Updated