Hi, Im trying to add multiple endpoint support to a zigbee project.
Im using the SDK for Zigbee 2.0 but in the documentation says:
"APIs for multiple endpoints A single endpoint is defined for the dimmable light device, just as for other standard Zigbee devices. If you want to declare a device with multiple endpoints for the application, use the following API calls to declare the endpoint list:
The endpoint list is stored as an array of the zb_af_endpoint_desc_t type. Each call to ZB_AF_DECLARE_ENDPOINT_DESC() adds an item to the ep_list_name array."
Which fails to declare ep_list_name. So I think its incomplete, can someone help me with the correct implementation?
Thanks in advance.
The documentation is instructing you to make an array of zb_af_endpoint_desc_t type and fill it with the desired ZB_AF_DECLARE_ENDPOINT_DESC():
zb_af_endpoint_desc_t ep_list_name =
... , \
You can use the macros ZB_AF_START_DECLARE_ENDPOINT_LIST and ZB_AF_FINISH_DECLARE_ENDPOINT_LIST as shown in old documentation.
Hi Jorgen, thanks for your fast answer, before posting the question I´ve already tried both ways but it keeps throwing me "expected expression before 'zb_af_endpoint_desc_t'" error. Do you know the cause?
Have you tried declaring the endpoints first (ep1_name and ep2_name), and add it to the list afterwards, as shown below (and on line 630-633 of zboss_api_af.h):
Your answer pointed me in the right direction, thanks!