Hi Mario,
thank you for the link to the community document, this was helpful. I had done everything in that document, except the hacking of the eZHA_RegisterBaseDeviceEndPoint function in the base_device.c file in the SDK. Instead I was calling the function eCLD_TemperatureMeasurementCreateTemperatureMeasurement from my app_zcl_task.c file.
So by looking at the code in eZHA_RegisterBaseDeviceEndPoint plus all the ZCL structures defined in the SDK, I realised that the zpscfg was not the issue, and that instead the critical part is the registration of an entire endpoint via the eZCL_Register function. So a single cluster cannot be added/registered in an existing endpoint, but instead the entire endpoint has to be defined, including all basic clusters and, in my case, the temperature measurement cluster, then this endpoint has to be registered through eZCL_Register.
So in order to do that, instead of hacking an SDK file as described in the community document, I decided to call eHA_RegisterTemperatureSensorEndPoint from TemperatureMeasurement.h instead of eZHA_RegisterBaseDeviceEndPoint in my app_zcl_task.c file. I also had to declare an instance of tsHA_TemperatureSensorDevice, that I called sTemperatureSensorDevice, to replace sBaseDevice.
I can then call eZCL_ReportAttribute, after assigning my temperature value to sTemperatureSensorDevice.sTemperatureMeasurementServerCluster.i16MeasuredValue and calling PDUM_hAPduAllocateAPduInstance to get an instance of PDUM_thAPduInstance to pass to eZCL_ReportAttribute. I am not sure if it is the right procedure to call PDUM_hAPduAllocateAPduInstance?
What surprised me the most is the fact that the clusters and endpoints declared in the zpscfg file do not seem to have any effect whatsoever on the ZCL functions that deal with attributes and endpoints, at least directly. Instead it looks like the entries in the zpscfg file are only used by the function ZPS_eAplAfUnicastAckDataReq which is called by eZCL_TransmitDataRequest, (which is itself called by eZCL_ReportAttribute). Is this duality of endpoint and cluster definition structures discussed/explained in a document?
Thank you!