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.
#define ZB_ZCL_GENERAL_GET_NEXT_REPORT_ATTR_REQ |
( |
|
data_buf, |
|
|
|
rep_attr_req |
|
) |
| |
Value:
(rep_attr_req) =
zb_buf_len(data_buf) >= ZB_ZCL_REPORT_ATTR_REQ_SIZE ? \
\
if (rep_attr_req) \
{ \
req_size = ZB_ZCL_REPORT_ATTR_REQ_SIZE; \
ZB_ZCL_HTOLE16_INPLACE(&(rep_attr_req)->attr_id); \
\
} \
\
{ \
} \
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.
- Parameters
-
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 |
- Note
- data_buf buffer should contain Report attribute command payload, without ZCL header. Each parsed Attribute report attribute is extracted from initial data_buf buffer
ZCL Report Attribute Command frame.
- See also
- ZCL spec, 2.4.11.1 Report Attributes Command
- Note
- Report attribute command contains variable number of attribute reports, zb_zcl_report_attr_req_t defines one attribute report