Compile-time Options

To enable the Colour Control cluster in the code to be built, it is necessary to add the following to the zcl_options.h file:

#define CLD_COLOUR_CONTROL

In addition, to include the software for a cluster client or server or both, it is necessary to add one or both of the following to the same file:

#define COLOUR_CONTROL_CLIENT
#define COLOUR_CONTROL_SERVER

The Colour Cluster cluster attributes reside on the server only. Therefore, attributes should not be enabled in the zcl_options.h file for the cluster client.

Optional Attributes

The optional attributes of the Colour Control cluster are enabled/disabled by defining the following in the zcl_options.h file:

  • For optional attributes from the ‘Colour Information’ attribute set:

    • CLD_COLOURCONTROL_ATTR_REMAINING_TIME

    • CLD_COLOURCONTROL_ATTR_DRIFT_COMPENSATION

    • CLD_COLOURCONTROL_ATTR_COMPENSATION_TEXT

    • CLD_COLOURCONTROL_ATTR_COLOUR_MODE

      • Certain attributes from this attribute set are enabled through a ‘ColourCapabilities’ Definition (see below) - these are u8CurrentHue, u8CurrentSaturation and u16ColourTemperatureMired.

  • For optional attributes from the ‘Defined Primaries Information’ and ‘Additional Defined Primaries Information’ attribute sets, the macro

    • CLD_COLOURCONTROL_ATTR_NUMBER_OF_PRIMARIES

      • is used to define the required number of colour primaries, N, in the range 1 to 6 (0xFF can also be specified if the number of primaries is not known). This macro is used to automatically enable the required attributes from these attribute sets - for example, if N is set to 4 then the following attributes are enabled:

      • u16Primary1X, u16Primary1Y, u8Primary1Intensity, u16Primary2X, u16Primary2Y, u8Primary2Intensity, u16Primary3X, u16Primary3Y, u8Primary3Intensity, u16Primary4X, u16Primary4Y, u8Primary4Intensity.

  • For optional attributes from the ‘Defined Colour Points Settings’ attribute set:

    • CLD_COLOURCONTROL_ATTR_WHITE_POINT_X

    • CLD_COLOURCONTROL_ATTR_WHITE_POINT_Y

    • CLD_COLOURCONTROL_ATTR_COLOUR_POINT_R_X

    • CLD_COLOURCONTROL_ATTR_COLOUR_POINT_R_Y

    • CLD_COLOURCONTROL_ATTR_COLOUR_POINT_R_INTENSITY

    • CLD_COLOURCONTROL_ATTR_COLOUR_POINT_G_X

    • CLD_COLOURCONTROL_ATTR_COLOUR_POINT_G_Y

    • CLD_COLOURCONTROL_ATTR_COLOUR_POINT_G_INTENSITY

    • CLD_COLOURCONTROL_ATTR_COLOUR_POINT_B_X

    • CLD_COLOURCONTROL_ATTR_COLOUR_POINT_B_Y

    • CLD_COLOURCONTROL_ATTR_COLOUR_POINT_B_INTENSITY

  • For optional attributes from the ‘Enhanced Colour Mode’ attributes, the following must be defined:

    • CLD_COLOURCONTROL_ATTR_ENHANCED_COLOUR_MODE

    • CLD_COLOURCONTROL_ATTR_COLOUR_CAPABILITIES

Global Attributes

Add this line to enable the optional Attribute Reporting Status attribute:

#define CLD_COLOURCONTROL_ATTR_ID_ATTRIBUTE_REPORTING_STATUS

Add this line to define the value (n) of the Cluster Revision attribute:

#define CLD_COLOURCONTROL_CLUSTER_REVISION <n>

The default value is 1, which corresponds to the revision of the cluster in the ZCL r6 specification (see Section 2.4).

‘Colour Capabilities’ Definition

If required, certain ‘Colour Information’ attributes and all ‘Enhanced Colour Mode’ attributes must be enabled through a ‘Colour Capabilities’ definition. Attributes are enabled as a group according to the required capability/functionality. The capabilities are detailed in the table below, with their corresponding attributes and macros.

Table 1. ‘Colour Capabilities’ Macros

Capability/Functionality

Attributes

Macro

Hue/Saturation

u8CurrentHue u8CurrentSaturation

COLOUR_CAPABILITY_HUE_SATURATION_SUPPORTED

Enhanced Hue

(also need Hue/Saturation)

u16EnhancedCurrentHue*

COLOUR_CAPABILITY_ENHANCE_HUE_SUPPORTED

Colour Loop

(also need Enhanced Hue)

u8ColourLoopActive* u8ColourLoopDirection* u16ColourLoopTime* u16ColourLoopStartEnhancedHue* u16ColourLoopStoredEnhancedHue*

COLOUR_CAPABILITY_COLOUR_LOOP_SUPPORTED

CIE XY Values

(this is mandatory)

u16CurrentX u16CurrentY

COLOUR_CAPABILITY_XY_SUPPORTED

Colour Temperature

u16ColourTemperatureMired u16ColourTemperatureMiredPhyMin* u16ColourTemperatureMiredPhyMax* u16ColourTemperatureMiredMin* u16ColourTemperatureMiredMax* bColourCoupleTemperatureMired-ToLevel* u16StartupColourTemperatureMired*

COLOUR_CAPABILITY_COLOUR_TEMPERATURE_SUPPORTED

The ‘Enhanced Colour Mode’ attributes also require ‘enhanced colour mode’ to be enabled through `#``define CLD_COLOURCONTROL_ATTR_ENHANCED_COLOUR_MODE`

The above macros automatically invoke the macros for the individual attributes in the capability group. For example, E_CLD_COLOURCONTROL_ATTR_CURRENT_HUE is invoked for the attribute u8CurrentHue.

The enabled Colour Capabilities are reflected in the ‘Enhanced Colour Mode’ attribute (bitmap) u16ColourCapabilities.

Example Colour Capabilities definitions are provided below for different devices.

ZLO Extended Colour Light:

#define CLD_COLOURCONTROL_COLOUR_CAPABILITIES 
           (COLOUR_CAPABILITY_HUE_SATURATION_SUPPORTED | \\
         COLOUR_CAPABILITY_ENHANCE_HUE_SUPPORTED  | \\
         COLOUR_CAPABILITY_COLOUR_LOOP_SUPPORTED | \\
         COLOUR_CAPABILITY_XY_SUPPORTED | \\
         COLOUR_CAPABILITY_COLOUR_TEMPERATURE_SUPPORTED)

ZLO Colour Light:

#define CLD_COLOURCONTROL_COLOUR_CAPABILITIES                    
              (COLOUR_CAPABILITY_HUE_SATURATION_SUPPORTED | \\
              COLOUR_CAPABILITY_ENHANCE_HUE_SUPPORTED    | \\
              COLOUR_CAPABILITY_COLOUR_LOOP_SUPPORTED    | \\
              COLOUR_CAPABILITY_XY_SUPPORTED)

ZLO Colour Temperature Light:

#define CLD_COLOURCONTROL_COLOUR_CAPABILITIES             
        (COLOUR_CAPABILITY_COLOUR_TEMPERATURE_SUPPORTED)

Parent topic:Colour Control Cluster