This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Reporting attributes on several endpoints issue

Hello,

I have got the exact same issue as described here: https://devzone.nordicsemi.com/f/nordic-q-a/58275/zigbee-reporting-not-work-while-using-multiple-endpoints/236706#236706

The issue also seems to appear in several other questions on the forum but there is no clear answer about how to resolve it.

 

Let me try to explain the case one more time:

- I've got 2 endpoints: thermostat endpoint and custom endpoint

- Both of them are reporting attributes

- I init using the same template as Thermostat EP:

#define ZB_HA_DECLARE_THERMOSTAT_EP(ep_name, ep_id, cluster_list) \
ZB_ZCL_DECLARE_THERMOSTAT_SIMPLE_DESC(ep_name, ep_id, \
ZB_HA_THERMOSTAT_IN_CLUSTER_NUM, ZB_HA_THERMOSTAT_OUT_CLUSTER_NUM); \
ZBOSS_DEVICE_DECLARE_REPORTING_CTX(reporting_info## device_ctx_name, \
ZB_HA_THERMOSTAT_REPORT_ATTR_COUNT); \
ZB_AF_DECLARE_ENDPOINT_DESC(ep_name, ep_id, ZB_AF_HA_PROFILE_ID, \
0, \
NULL, \
ZB_ZCL_ARRAY_SIZE(cluster_list, zb_zcl_cluster_desc_t), cluster_list, \
(zb_af_simple_desc_1_1_t*)&simple_desc_##ep_name, \
ZB_HA_THERMOSTAT_REPORT_ATTR_COUNT, reporting_info## device_ctx_name, \
0, NULL)

- I then declare the context using:  ZBOSS_DECLARE_DEVICE_CTX_2_EP(thermostat_ctx, custom_ep, thermostat_ep); 
Depending on which order I put the endpoint in the macro argument, I can report attributes only with the last argument (here `thermostat_ep`).

As a workaround, I removed the call to ZBOSS_DEVICE_DECLARE_REPORTING_CTX in the custom endpoint and increased `ZB_HA_THERMOSTAT_REPORT_ATTR_COUNT` to count every reporting attribute on both endpoints (while still passing the reporting structure in the second endpoint through ZB_AF_DECLARE_ENDPOINT_DESC).

How would you declare two endpoints reporting attributes on both of them? I guess it's not possible to declare two REPORTING_CTX? (the last one registered overwrites the previous ones?)

Please submit a clear way to do so.

Best,
Cyril
Related