Behaviour:
Declaring a carbon dioxide attribute list with
/** @brief Concentration cluster attributes additions data.
*/
ZB_ZCL_DECLARE_CARBON_DIOXIDE_MEASUREMENT_ATTRIB_LIST(
co2_sensor_attr_list,
&dev_ctx.co2_attr.measurement_attr,
&dev_ctx.co2_attr.min_attr,
&dev_ctx.co2_attr.max_attr,
&dev_ctx.co2_attr.tolerance);
results in
C:/Users/konta/Downloads/zigbee/app/src/main.c:136:26: error: expected ')' before '&' token
136 | co2_sensor_attr_list,
| ^
| )
137 | &dev_ctx.co2_attr.measurement_attr,
| ~
C:/Users/konta/Downloads/zigbee/app/src/main.c:152:25: error: macro "ZB_DECLARE_ENV_SENSOR_CLUSTER_LIST" passed 10 arguments, but takes just 9
152 | co2_sensor_attr_list);
| ^
In file included from C:/Users/konta/Downloads/zigbee/app/src/main.c:35:
C:/Users/konta/Downloads/zigbee/app/src/beelight.h:186: note: macro "ZB_DECLARE_ENV_SENSOR_CLUSTER_LIST" defined here
186 | #define ZB_DECLARE_ENV_SENSOR_CLUSTER_LIST( \
|
C:/Users/konta/Downloads/zigbee/app/src/main.c:142:1: warning: data definition has no type or storage class
142 | ZB_DECLARE_ENV_SENSOR_CLUSTER_LIST(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/konta/Downloads/zigbee/app/src/main.c:142:1: error: type defaults to 'int' in declaration of 'ZB_DECLARE_ENV_SENSOR_CLUSTER_LIST' [-Werror=implicit-int]
In file included from C:/Users/konta/Downloads/zigbee/ncs-zigbee/lib/zboss/include/zboss_api_zcl.h:50,
from C:/Users/konta/Downloads/zigbee/ncs-zigbee/lib/zboss/include/zboss_api.h:63,
from C:/Users/konta/Downloads/zigbee/app/src/main.c:27:
C:/Users/konta/Downloads/zigbee/ncs-zigbee/lib/zboss/include/zcl/zb_zcl_common.h:229:48: warning: excess elements in array initializer
229 | #define ZB_ZCL_CLUSTER_ID_IDENTIFY 0x0003U /*!< Identify cluster identifier. */
| ^~~~~~~
C:/Users/konta/Downloads/zigbee/ncs-zigbee/lib/zboss/include/zcl/zb_zcl_common.h:229:48: note: in definition of macro 'ZB_ZCL_CLUSTER_ID_IDENTIFY'
229 | #define ZB_ZCL_CLUSTER_ID_IDENTIFY 0x0003U /*!< Identify cluster identifier. */
| ^~~~~~~
C:/Users/konta/Downloads/zigbee/app/src/beelight.h:292:5: note: in expansion of macro 'ZB_ZCL_DECLARE_HA_ENV_SENSOR_SIMPLE_DESC'
292 | ZB_ZCL_DECLARE_HA_ENV_SENSOR_SIMPLE_DESC( \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/konta/Downloads/zigbee/app/src/main.c:154:1: note: in expansion of macro 'ZB_DECLARE_ENV_SENSOR_EP'
154 | ZB_DECLARE_ENV_SENSOR_EP(
| ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/konta/Downloads/zigbee/ncs-zigbee/lib/zboss/include/zcl/zb_zcl_common.h:229:48: note: (near initialization for 'simple_desc_env_sensor_ep.app_cluster_list')
229 | #define ZB_ZCL_CLUSTER_ID_IDENTIFY 0x0003U /*!< Identify cluster identifier. */
| ^~~~~~~
C:/Users/konta/Downloads/zigbee/ncs-zigbee/lib/zboss/include/zcl/zb_zcl_common.h:229:48: note: in definition of macro 'ZB_ZCL_CLUSTER_ID_IDENTIFY'
229 | #define ZB_ZCL_CLUSTER_ID_IDENTIFY 0x0003U /*!< Identify cluster identifier. */
| ^~~~~~~
C:/Users/konta/Downloads/zigbee/app/src/beelight.h:292:5: note: in expansion of macro 'ZB_ZCL_DECLARE_HA_ENV_SENSOR_SIMPLE_DESC'
292 | ZB_ZCL_DECLARE_HA_ENV_SENSOR_SIMPLE_DESC( \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/konta/Downloads/zigbee/app/src/main.c:154:1: note: in expansion of macro 'ZB_DECLARE_ENV_SENSOR_EP'
154 | ZB_DECLARE_ENV_SENSOR_EP(
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/Users/konta/Downloads/zigbee/ncs-zigbee/lib/zboss/include/zboss_api.h:52:
C:/Users/konta/Downloads/zigbee/app/src/main.c:157:5: error: 'env_sensor_clusters' undeclared here (not in a function); did you mean 'env_sensor_ep'?
157 | env_sensor_clusters);
| ^~~~~~~~~~~~~~~~~~~
C:/Users/konta/Downloads/zigbee/ncs-zigbee/lib/zboss/include/zboss_api_af.h:552:5: note: in definition of macro 'ZB_AF_DECLARE_ENDPOINT_DESC'
552 | cluster_number, \
| ^~~~~~~~~~~~~~
C:/Users/konta/Downloads/zigbee/app/src/beelight.h:308:9: note: in expansion of macro 'ZB_ZCL_ARRAY_SIZE'
308 | ZB_ZCL_ARRAY_SIZE(cluster_list, zb_zcl_cluster_desc_t), \
| ^~~~~~~~~~~~~~~~~
C:/Users/konta/Downloads/zigbee/app/src/main.c:154:1: note: in expansion of macro 'ZB_DECLARE_ENV_SENSOR_EP'
154 | ZB_DECLARE_ENV_SENSOR_EP(
| ^~~~~~~~~~~~~~~~~~~~~~~~
cc1.exe: some warnings being treated as errors
ninja: build stopped: subcommand failed.
Using
ZB_ZCL_CLUSTER_DESC( \
ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT, \
ZB_ZCL_ARRAY_SIZE(co2_attr_list, zb_zcl_attr_t), \
(co2_attr_list), \
ZB_ZCL_CLUSTER_SERVER_ROLE, \
ZB_ZCL_MANUF_CODE_INVALID \
), \
results in
C:/Users/konta/Downloads/zigbee/app/src/beelight.h:250:13: error: 'ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT_CLIENT_ROLE_INIT' undeclared here (not in a function); did you mean 'ZB_ZCL_CLUSTER_ID_REL_HUMIDITY_MEASUREMENT_CLIENT_ROLE_INIT'? 250 | ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT,
"zb_zcl_carbon_dioxide_measurement.h" and the macro "ZB_ZCL_CLUSTER_ID_CARBON_DIOXIDE_MEASUREMENT_CLIENT_ROLE_INIT" are available. Adding the include for the header file results in a linker error. I think the files are not used properly.
Environment:
NCS 2.9.0 with NCS Zigbee R23 for an nRF54
Edit:
I found this
/* * The following ZCL clusters use zb_single_t, which is not supported * if ZB_NO_SINGLE_PRECISION_DATA_TYPE is defined. */ // TODO: Analog Input (Basic) also uses zb_single_t #undef ZB_ZCL_SUPPORT_CLUSTER_ANALOG_VALUE #undef ZB_ZCL_SUPPORT_CLUSTER_MULTISTATE_VALUE /* All 4.13 Concentration Measurement clusters */ #undef ZB_ZCL_SUPPORT_CLUSTER_PM2_5_MEASUREMENT #undef ZB_ZCL_SUPPORT_CLUSTER_CARBON_DIOXIDE_MEASUREMENT #endif /* ZB_NO_SINGLE_PRECISION_DATA_TYPE */
So I guess it´s intentional that these clusters can´t be used?