Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Adding ZCL clusters to application - Temperature - Error with build

Hi,

I've been trying to learn how to use the SDK and I was following the Adding ZCL clusters to application guide to add temperature. I skipped adding the on/off switch and so I used `ZBOSS_DECLARE_DEVICE_CTX_2_EP` instead of `ZBOSS_DECLARE_DEVICE_CTX_3_EP`.

I've been getting build errors and I haven't been able to figure out what I've done wrong. I've been comparing my main.c to the guide, and also to several of the SDK examples (light bulb, light switch, weather station, etc.). I'm using SDK V2.2.0

Can somebody please help me figure this out?

Kind regards,
Dan

What I've Done:

Following the guide, I included zb_zcl_temp_measurement_addons.h

I defined the temperature measurement endpoint and placed this under the app template endpoint.

I added the temperature measurement attributes to the zb_device_ctx structure.

I declared the attribute list for the temperature measurement cluster, the cluster list for the device, declared the endpoint, and edited the device context. I also moved the device context below the other declarations.

VS Code highlights `TEMPERATURE_SENSOR_ENDPOINT` from the `ZB_HA_DECLARE_TEMPERATURE_SENSOR_EP` declaration saying "expected an identifier".
And it highlights `ZBOSS_DECLARE_DEVICE_CTX_2_EP(...` saying "identifier "temperature_sensor_ep" is undefined".

When I try to build, I get the following output in terminal.