Dimmable Light

The Dimmable Light device is a light that can have its luminance varied, and can be switched on and off. The permitted range of light levels is 0x01 to 0xFE.

  • The Device ID is 0x0101.

  • The header file for the device is dimmable_light.h.

  • The clusters supported by the device are listed in Section 3.2.1.

  • The device structure, tsZLO_DimmableLightDevice, is listed in Section 3.2.2.

  • The endpoint registration function for the device, eZLO_RegisterDimmableLightEndPoint(), is detailed in Section 3.2.3.

Supported clusters

The clusters used by the Dimmable Light device are listed in the table below.

Table 15. Clusters for Dimmable Light

Server (Input) side

Client (Output) side

Mandatory

Basic

Identify

On/Off

Level control

Scenes

Groups

Optional

Touchlink commissioning

OTA upgrade

Occupancy sensing

The mandatory attributes within each cluster for this device type are indicated in the ZigBee Lighting and Occupancy Device Specification (15-0014-01).

Parent topic:Dimmable Light

Device Structure

The following tsZLO_DimmableLightDevice structure is the shared structure for a Dimmable Light device:

typedefstruct
{
tsZCL_EndPointDefinitionsEndPoint;
/*Clusterinstances*/
tsZLO_DimmableLightDeviceClusterInstancessClusterInstance;
#if(definedCLD_BASIC)&&(definedBASIC_SERVER)
/*BasicCluster-Server*/
tsCLD_BasicsBasicServerCluster;
#endif
#if(definedCLD_IDENTIFY)&&(definedIDENTIFY_SERVER)
/*IdentifyCluster-Server*/
tsCLD_IdentifysIdentifyServerCluster;
tsCLD_IdentifyCustomDataStructure
sIdentifyServerCustomDataStructure;
#endif
#if(definedCLD_ONOFF)&&(definedONOFF_SERVER)
/*On/OffCluster-Server*/
tsCLD_OnOffsOnOffServerCluster;
tsCLD_OnOffCustomDataStructuresOnOffServerCustomDataStructure;
#endif
#if(definedCLD_GROUPS)&&(definedGROUPS_SERVER)
/*GroupsCluster-Server*/
tsCLD_GroupssGroupsServerCluster;
tsCLD_GroupsCustomDataStructuresGroupsServerCustomDataStructure;
#endif
#if(definedCLD_SCENES)&&(definedSCENES_SERVER)
/*ScenesCluster-Server*/
tsCLD_ScenessScenesServerCluster;
tsCLD_ScenesCustomDataStructuresScenesServerCustomDataStructure;
#endif
#if(definedCLD_LEVEL_CONTROL)&&(definedLEVEL_CONTROL_SERVER)
/*LevelControlCluster-Server*/
tsCLD_LevelControlsLevelControlServerCluster;
tsCLD_LevelControlCustomDataStructure
sLevelControlServerCustomDataStructure;
#endif
#if(definedCLD_ZLL_COMMISSION)&&(definedZLL_COMMISSION_SERVER)
tsCLD_ZllCommissionsZllCommissionServerCluster;
tsCLD_ZllCommissionCustomDataStructure
sZllCommissionServerCustomDataStructure;
#endif
#if(definedCLD_OTA)&&(definedOTA_CLIENT)
/*OTAcluster-Client*/
tsCLD_AS_OtasCLD_OTA;
tsOTA_CommonsCLD_OTA_CustomDataStruct;
#endif
#if(definedCLD_OCCUPANCY_SENSING)&&(definedOCCUPANCY_SENSING_CLIENT)
/*OccupancySensingCluster-Client*/
tsCLD_OccupancySensingsOccupancySensingClientCluster;
#endif
}tsZLO_DimmableLightDevice;

Parent topic:Dimmable Light

Registration Function

The following eZLO_RegisterDimmableLightEndPoint() function is the endpoint registration function for a Dimmable Light device.

teZCL_Status eZLO_RegisterDimmableLightEndPoint(
              uint8 u8EndPointIdentifier,
    tfpZCL_ZCLCallBackFunction cbCallBack,
        tsZLO_DimmableLightDevice *psDeviceInfo);

Description

This function is used to register an endpoint which supports a Dimmable Light device. The function must be called after eZCL_Initialise().

The specified identifier for the endpoint is a number in the range 1 to 240 (endpoint 0 is reserved for ZigBee use). Application endpoints are normally numbered consecutively starting at 1. The specified number must be less than or equal to the value of ZLO_NUMBER_OF_ENDPOINTS defined in the zcl_options.h file, which represents the highest endpoint number used for applications.

While invoking this function, specify a user-defined callback function, which is invoked when an event associated with the endpoint occurs. This callback function is defined according to the typedef:

typedef void(* tfpZCL_ZCLCallBackFunction)
(tsZCL_CallBackEvent *pCallBackEvent);

Also provide a pointer to a tsZLO_DimmableLightDevice structure, described in Section 3.2.2. This structure stores all variables relating to the color Controller device associated with the endpoint. The sEndPoint and sClusterInstance fields of this structure are set by this function and must not be directly written to by the application.

The function may be called multiple times if more than one endpoint is used - for example, if more than one Dimmable Light device is housed in the same hardware, sharing the same module.

Parameters

  • u8EndPointIdentifier: Endpoint that is to be associated with the registered structure and callback function.

  • cbCallBack: Pointer to the function that is used to indicate events to the application for this endpoint.

  • psDeviceInfo: Pointer to the structure that acts as storage for all variables related to the device being registered on this endpoint (see Section 3.2.2). The sEndPoint and sClusterInstance fields are set by this register function for internal use and must not be written to by the application.

Returns

  1. E_ZCL_SUCCESS

  2. E_ZCL_FAIL

  3. E_ZCL_ERR_PARAMETER_NULL

  4. E_ZCL_ERR_PARAMETER_RANGE

  5. E_ZCL_ERR_EP_RANGE

  6. E_ZCL_ERR_CLUSTER_0

  7. E_ZCL_ERR_CALLBACK_NULL

  8. E_ZCL_ERR_CLUSTER_NULL

  9. E_ZCL_ERR_SECURITY_RANGE

  10. E_ZCL_ERR_CLUSTER_ID_RANGE

  11. E_ZCL_ERR_MANUFACTURER_SPECIFIC

  12. E_ZCL_ERR_ATTRIBUTE_TYPE_UNSUPPORTED

  13. E_ZCL_ERR_ATTRIBUTE_ID_ORDER

  14. E_ZCL_ERR_ATTRIBUTES_ACCESS

The above codes are described in the ZCL User Guide (JNUG3132).

Parent topic:Dimmable Light

Parent topic:Lighting and Occupancy Device Types