Compilation error when adding two endpoints with Temperature Measurement clusters

Hi,

I am trying to create a device two temperature measurements.

I have created two endpoints like this:

ZB_ZCL_DECLARE_TEMP_MEASUREMENT_ATTRIB_LIST(temp_measurement_attr_list_1,
											&dev_ctx.temp_1_measure_attrs.measure_value,
											&dev_ctx.temp_1_measure_attrs.min_measure_value,
											&dev_ctx.temp_1_measure_attrs.max_measure_value,
											&dev_ctx.temp_1_measure_attrs.tolerance);

ZB_HA_DECLARE_TEMPERATURE_SENSOR_CLUSTER_LIST(temperature_sensor_clusters_1, basic_attr_list, identify_attr_list, temp_measurement_attr_list_1);

#define TEMPERATURE_SENSOR_ENDPOINT_1 11

ZB_HA_DECLARE_TEMPERATURE_SENSOR_EP(temperature_sensor_ep_one, TEMPERATURE_SENSOR_ENDPOINT_1, temperature_sensor_clusters_1);

ZB_ZCL_DECLARE_TEMP_MEASUREMENT_ATTRIB_LIST(temp_measurement_attr_list_2,
											&dev_ctx.temp_2_measure_attrs.measure_value,
 											&dev_ctx.temp_2_measure_attrs.min_measure_value,
 											&dev_ctx.temp_2_measure_attrs.max_measure_value,
 											&dev_ctx.temp_2_measure_attrs.tolerance);

ZB_HA_DECLARE_TEMPERATURE_SENSOR_CLUSTER_LIST(temperature_sensor_clusters_2, basic_attr_list, identify_attr_list, temp_measurement_attr_list_2);

#define TEMPERATURE_SENSOR_ENDPOINT_2 12

ZB_HA_DECLARE_TEMPERATURE_SENSOR_EP(temperature_sensor_ep_two, TEMPERATURE_SENSOR_ENDPOINT_2, temperature_sensor_clusters_2);

ZBOSS_DECLARE_DEVICE_CTX_2_EP(device_ctx, temperature_sensor_ep_one, temperature_sensor_ep_two);

but when I try and compile, I get this error:

G:/ncs/v2.8.0/nrfxlib/zboss/production/include/zboss_api_af.h:257:32: error: redefinition of 'struct zb_af_simple_desc_3_1_s'

I found a few mentions of this, but no definite fix was given. 

I used this hack:

#undef ZB_DECLARE_SIMPLE_DESC
#define ZB_DECLARE_SIMPLE_DESC(...)

which got my code to compile.

However, I noticed a separate issue, which I feel is caused by this hack. 

When I add my sensor to Home Assistant, the two temperature measurements appear like this:

However, when I change the device (using a potentiometer to adjust the ADC input), only one of the values (the first) actually changes. Both ADC pins get the same voltage, so the Home Assistant values should *both* change.

If I "Read" the endpoint cluster directly, the value returned is correct. 

I believe the hack is impacting the attribute reporting. 

Do you have any idea how I can successfully declare two endpoints with Temperature clusters?

Parents Reply Children
Related