AnsweredAssumed Answered

Bug in Zigbee 3.0 (JN-SW-4170) - Does not compile in a certain config

Question asked by Witold Sowa on Sep 11, 2019
Latest reply on Nov 4, 2019 by Mario Ignacio Castaneda Lopez

Hi,

I've following problem with JN-SW-4170 (Zigbee 3.0 SDK for JN516x) latest version (1840). With following lines in my zlc_options.h

#define CLD_DEVICE_TEMPERATURE_CONFIGURATION
#define DEVICE_TEMPERATURE_CONFIGURATION_SERVER
#define CLD_DEVTEMPCFG_ATTR_ID_MIN_TEMP_EXPERIENCED
#define CLD_DEVTEMPCFG_ATTR_ID_MAX_TEMP_EXPERIENCED

I got such compilation error:

 

In file included from ../../../../sdk/JN-SW-4170/Components/ZCL/Devices/ZHA/Generic/Source/plug_control.c:54:0:
../../../../sdk/JN-SW-4170/Components/ZCL/Devices/ZHA/Generic/Include/plug_control.h:172:5: error: unknown type name 'tsCLD_DeviceTemperatureConfiguration'
../../../../sdk/JN-SW-4170/Components/ZCL/Devices/ZHA/Generic/Source/plug_control.c: In function 'eHA_RegisterPlugControlEndPoint':
../../../../sdk/JN-SW-4170/Components/ZCL/Devices/ZHA/Generic/Source/plug_control.c:153:5: warning: implicit declaration of function 'eCLD_DeviceTemperatureConfigurationCreateDeviceTemperatureConfiguration' [-Wimplicit-function-declaration]
../../../../sdk/JN-SW-4170/Components/ZCL/Devices/ZHA/Generic/Source/plug_control.c:155:28: error: 'sCLD_DeviceTemperatureConfiguration' undeclared (first use in this function)
../../../../sdk/JN-SW-4170/Components/ZCL/Devices/ZHA/Generic/Source/plug_control.c:155:28: note: each undeclared identifier is reported only once for each function it appears in
../../../../sdk/JN-SW-4170/Components/ZCL/Devices/ZHA/Generic/Source/plug_control.c:157:28: error: 'au8DeviceTempConfigServerClusterAttributeControlBits' undeclared (first use in this function)
make: *** [plug_control.o] Error 1

I have fixed it by adding to plug_control.h

#include "DeviceTemperatureConfiguration.h"

and changeing line 151 so the last argument to function call is au8DeviceTempConfigClusterAttributeControlBits[0] as in all other devices as au8DeviceTempConfigServerClusterAttributeControlBits variable is not defined.

 

I hope other will fine it useful and more imporatnaty this fix will land in next SDK release!!!

Outcomes