ZCL attribute reporting being described in ZCL spec, subclauses 2.4.7 through 2.4.11, and subclauses covering clusters with reportable attributes.
API for attribute reporting configuring and configuration details reading documented in: Configure reporting command sending and parsing, and Report attribute command parsing respectively.
Since all events related to attribute reporting are being handled internally, application can be provided with information on attribute report receipt event, and attribute report not received within predefined interval event. To handle these events, application may set "report attribute" and "no reporting" callbacks with ZB_ZCL_SET_REPORT_ATTR_CB() and ZB_ZCL_SET_NO_REPORTING_CB() macros respectively.
- Example
{
zb_test_reporting_info_t *test_rep_info =
ZB_GET_BUF_PARAM(buf, zb_test_reporting_info_t);
TRACE_MSG(TRACE_ZCL1,
">> report_attribute_cb addr %d ep %hd, cluster %d, attr %d",
(FMT__D_H_D_D, addr, ep, cluster_id, attr_id));
ZVUNUSED(attr_type);
{
g_error_cnt++;
}
TRACE_MSG(TRACE_ZCL2,
"reporting interval %d, value %hd",
(FMT__D_H, g_reporting_interval, *value));
test_rep_info->ep = ep;
test_rep_info->cluster_id = cluster_id;
test_rep_info->attr_id = attr_id;
test_rep_info->value = *value;
test_rep_info->rep_interval = g_reporting_interval;
g_reporting_interval = 0;
next_step(buf);
TRACE_MSG(TRACE_ZCL1,
"<< report_attribute_cb", (FMT__0));
}
For more information see 546_reporting, reporting_srv samples
Informs application that some attribute value was not reported during defined time interval.
- Parameters
-
ep | - endpoint number |
cluster_id | - cluster ID |
attr_id | - attribute ID |
Informs application about received attribute report.
- Parameters
-
addr | - source address |
ep | - source endpoint number |
cluster_id | - cluster ID |
attr_id | - attribute ID |
value | - pointer to reported data value |
Start attribute reporting.
- Parameters
-
ep | - endpoint number |
cluster_id | - cluster ID |
attr_id | - attribute ID |
- Returns
- RET_OK if reporting is successfully started
RET_DOES_NOT_EXIST if reporting can't be configured with given parameters (i.e cluster not present)
Stop attribute reporting.
- Parameters
-
ep | - endpoint number |
cluster_id | - cluster ID |
attr_id | - attribute ID |
- Returns
- RET_OK if reporting is successfully stopped
RET_DOES_NOT_EXIST if reporting was not set up with given parameters
Check if an atrtibute is configured for reporting or not.
- Parameters
-
ep | - endpoint number |
cluster_id | - cluster ID |
attr_id | - attribute ID |
- Returns
- ZB_TRUE if attribute is reported