Hi Navdeep,
If you want to add a new cluster to a device, you do not need to add an extra endpoint. In ZigBee, all clusters can be added as optional supported clusters. This means it will be the same device but with support for additional clusters. Doing this saves RAM because there are less endpoints. Also, by having two endpoints, it requires to certify both endpoints separately.
To do this, you will need to go into the SDK (for example a DimmableLight) and modify the following file:
C:\NXP\bstudio_nxp\sdk\JN-SW-4168\Components\ZCL\Profiles\HA\Lighting\Source\dimmable_light.c
C:\NXP\bstudio_nxp\sdk\JN-SW-4168\Components\ZCL\Profiles\HA\Lighting\Include\dimmable_light.h
You can use the other clusters as reference to add additional clusters. The cluster that needs to be added should be add to the following:
tsHA_DimmableLightDeviceClusterInstances
tsHA_DimmableLightDevice
eHA_RegisterDimmableLightEndPoint
If you want to add illuminance sensing to the device, look at the following file:
C:\NXP\bstudio_nxp\sdk\JN-SW-4168\Components\ZCL\Profiles\HA\Lighting\Source\light_sensor.c
C:\NXP\bstudio_nxp\sdk\JN-SW-4168\Components\ZCL\Profiles\HA\Lighting\Include\light_sensor.h
You should see the following define in light_sensor.c, register light sensor:
#if (defined CLD_ILLUMINANCE_MEASUREMENT) && (defined ILLUMINANCE_MEASUREMENT_SERVER)
/* Create an instance of an Illuminance Measurement cluster as a server */
eCLD_IlluminanceMeasurementCreateIlluminanceMeasurement(
&psDeviceInfo->sClusterInstance.sIlluminanceMeasurementServer,
TRUE,
&sCLD_IlluminanceMeasurement,
&psDeviceInfo->sIlluminanceMeasurementServerCluster,
&au8IlluminanceMeasurementServerAttributeControlBits[0]);
#endif
And the following define in light_sensor.h, structure tsHA_LightSensorDeviceClusterInstances
#if (defined CLD_ILLUMINANCE_MEASUREMENT) && (defined ILLUMINANCE_MEASUREMENT_SERVER)
tsZCL_ClusterInstance sIlluminanceMeasurementServer;
#endif
And finally the following define in light_sensor.h, structure tsHA_LightSensorDevice
#if (defined CLD_ILLUMINANCE_MEASUREMENT) && (defined ILLUMINANCE_MEASUREMENT_SERVER)
/* Illuminance Measurement Cluster - Server */
tsCLD_IlluminanceMeasurement sIlluminanceMeasurementServerCluster;
#endif
Hope it helps
Best Regards,
Mario