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.
For more information see any HA sample
◆ ZB_ZCL_GENERAL_GET_NEXT_REPORT_ATTR_REQ
#define ZB_ZCL_GENERAL_GET_NEXT_REPORT_ATTR_REQ |
( |
|
data_buf, |
|
|
|
rep_attr_req |
|
) |
| |
Value:{ \
zb_uint8_t req_size = 0xff; \
(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); \
\
req_size += \
zb_zcl_get_attribute_size((rep_attr_req)->attr_type, (rep_attr_req)->attr_value) - \
{ \
ZB_ZCL_FIX_ENDIAN((rep_attr_req)->attr_value, (rep_attr_req)->attr_type); \
} \
\
{ \
} \
else \
{ \
(rep_attr_req) = NULL; \
} \
} \
}
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
◆ zb_zcl_report_attr_req_t
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