Scenes Cluster
This chapter describes the Scenes cluster that allows scenes to be managed.
The Scenes cluster has a Cluster ID of 0x0005.
Overview
A scene is a set of stored attribute values for one or more cluster instances, where these cluster instances may exist on endpoints on one or more devices.
The Scenes cluster allows standard values for these attributes to be set and retrieved. Thus, the cluster can be used to put the network or part of the network into a pre-defined mode (for example, Night or Day mode for a lighting network). These pre-defined scenes can be used as a basis for ‘mood lighting’. A Scenes cluster instance must be created on each endpoint which contains a cluster that is part of a scene.
A scene is often associated with a group (which collects together a set of endpoints over one or more devices) - groups are described in Chapter 12. A scene may, however, be used without a group.
Note: When the Scenes cluster is used on an endpoint, a Groups cluster instance must always be created on the same endpoint, even if a group is not used for the scene.
If a cluster on a device is used in a scene, an entry for the scene must be contained in the Scene table on the device. A Scene table entry includes the scene ID, the group ID associated with the scene (0x0000 if there is no associated group), the scene transition time (amount of time to switch to the scene), and the attribute settings for the clusters on the device. The scene ID must be unique within the group with which the scene is associated.
To use the functionality of this cluster, you must include the file Scenes.h in your application and enable the cluster by defining CLD_SCENES in the zcl_options.h file.
It is also necessary to enable the cluster as a server or client, or as both:
The cluster server is able to receive commands to access scenes.
The cluster client is able to send commands to the server to request read or write access to scenes.
The inclusion of the client or server software must be pre-defined in the compile-time options of the application (in addition, if the cluster is to reside on a custom endpoint then the role of client or server must also be specified when creating the cluster instance).
The compile-time options for the Scenes cluster are fully detailed in Section 13.9.
Parent topic:Scenes Cluster
Scenes Cluster structure and attributes
The structure definition for the Scenes cluster is:
typedef struct
{
#ifdef SCENES_SERVER
zuint8 u8SceneCount;
zuint8 u8CurrentScene;
zuint16 u16CurrentGroup;
zbool bSceneValid;
zuint8 u8NameSupport;
#ifdef CLD_SCENES_ATTR_LAST_CONFIGURED_BY
zieeeaddress u64LastConfiguredBy;
#endif
#endif
zuint16 u16ClusterRevision;
} tsCLD_Scenes;
where:
u8SceneCount
is the number of scenes currently in the Scene table.u8CurrentScene
is the scene ID of the last scene invoked on the device.u16CurrentGroup
is the group ID of the group associated with the last scene invoked (or 0x0000 if this scene is not associated with a group).bSceneValid
indicates whether the current state of the device corresponds to the values of theCurrentScene
andCurrentGroup
attributes (TRUE if they do, FALSE if they do not).u8NameSupport
indicates whether scene names are supported - if the most significant bit is 1 then they are supported, otherwise they are not supported.u64LastConfiguredBy
is the 64-bit IEEE address of the device that last configured the Scene table (0xFFFFFFFFFFFFFFFF indicates that the address is unknown or the table has not been configured).u16ClusterRevision
is a mandatory attribute that specifies the revision of the cluster specification on which this cluster instance is based. The cluster specification in the ZCL r6 corresponds to a cluster revision of 1. The value is incremented by one for each subsequent revision of the cluster specification. This attribute is also described in Section 2.4.
Parent topic:Scenes Cluster
Initialization
The function eCLD_ScenesCreateScenes() is used to create an instance of the Scenes cluster. The function is generally called by the initialization function for the host device.
Parent topic:Scenes Cluster
Sending Remote Commands
The NXP implementation of the ZCL provides functions for sending commands between a Scenes cluster client and server. A command is sent from the client to one or more endpoints on the server. Multiple endpoints can usually be targeted using binding or group addressing.
Note: Commands can also be issued for operations on the local node, as described in Section 13.5.
Creating a Scene
In order to create a scene, add an entry for the scene to the Scene table on every device that contains a cluster, which is associated with the scene.
Use the function eCLD_ScenesCommandAddSceneRequestSend() to request a scene to be added to a Scene table on a remote device. Invoking this function sends a request to a single device or to multiple devices (using binding or group addressing). The fields of the Scene table entry are specified in the payload of the request.
Alternatively:
The function eCLD_ScenesCommandEnhancedAddSceneRequestSend() can be used to request that a scene is added to a Scene table on a remote device. This method allows the transition time for the scene to be set in units of tenths of a second (rather than seconds).
A scene can be created by saving the current attribute settings of the relevant clusters. In this way, the current state of the system can be captured as a scene and reapplied ‘at the touch of a button’ when required. For example scenes can be created for lighting levels in a ‘smart lighting’ system. The current settings are stored as a scene in the Scene table using eCLD_ScenesCommandStoreSceneRequestSend(). This function can send the request to a single device or multiple devices. If a Scene table entry exists with the same scene ID and group ID, the existing cluster settings in the entry are overwritten with the new ‘captured’ settings.
Note: This operation of capturing the current system state as a scene does not result in meaningful settings for the transition time and scene name fields of the Scene table entry. If non-null values are required for these fields, the table entry should be created in advance with the desired field values using eCLD_ScenesCommandAddSceneRequestSend().
Parent topic:Sending Remote Commands
Copying a Scene
Scene settings can be copied from one scene to another scene on the same remote endpoint using the eCLD_ScenesCommandCopySceneSceneRequestSend() function. This function allows the settings from an existing scene with a specified source scene ID and associated group ID to be copied to a new scene with a specified destination scene ID and associated group ID.
Note: If an entry corresponding to the target scene ID and group ID exists in the Scene table on the endpoint, the entry settings are overwritten with the copied settings. Otherwise, a new Scene table entry is created with these settings.
The above function also allows all scenes associated with particular group ID to be copied to another group ID. In this case, the original scene IDs are maintained but are associated with the new group ID (any specified source and destination scene IDs are ignored). Thus, the same scene IDs are associated with two different group IDs.
Parent topic:Sending Remote Commands
Applying a Scene
The cluster settings of a scene stored in the Scene table can be retrieved and applied to the system by calling eCLD_ScenesCommandRecallSceneRequestSend(). Again, this function can send a request to a single device or to multiple devices (using binding or group addressing).
If the required scene does not contain any settings for a particular cluster or there are some missing attribute values for a cluster, these attribute values remain unchanged in the implementation of the cluster - that is, the corresponding parts of the system do not change their states.
Parent topic:Sending Remote Commands
Deleting a Scene
Two functions are provided for removing scenes from the system:
eCLD_ScenesCommandRemoveSceneRequestSend() can be used to request the removal of the destination endpoint from a particular scene - that is, to remove the scene from the Scene table on the target device.
eCLD_ScenesCommandRemoveAllScenesRequestSend() can be used to request that the target device removes scenes associated with a particular group ID/address - that is, remove all Scene table entries relating to this group ID. Specifying a group ID of 0x0000 removes all scenes not associated with a group.
Parent topic:Sending Remote Commands
Obtaining Information about Scenes
The following functions are provided for obtaining information about scenes:
eCLD_ScenesCommandViewSceneRequestSend() can be used to request information on a particular scene on the destination endpoint. Only one device may be targeted by this function. The target device returns a response containing the relevant information.
Alternatively, eCLD_ScenesCommandEnhancedViewSceneRequestSend() can be used, which allows the transition time for the scene to be obtained in units of tenths of a second (rather than seconds).
eCLD_ScenesCommandGetSceneMembershipRequestSend() can be used to discover which scenes are associated with a particular group on a device. The request can be sent to a single device or to multiple devices. The target device returns a response containing the relevant information (in the case of multiple target devices, no response is returned from a device that does not contain a scene associated with the specified group ID). In this way, the function can be used to determine the unused scene IDs.
Parent topic:Sending Remote Commands
Parent topic:Scenes Cluster
Issuing Local Commands
Some of the operations described in Section 13.4 that correspond to remote commands can also be performed locally, as described below.
Creating a Scene
A scene can be created on the local node using either of the following functions:
eCLD_ScenesAdd(): This function can be used to add a new scene to the Scene table on the specified local endpoint. A scene ID and an associated group ID must be specified (the latter must be set to 0x0000 if there is no group association). If a scene with these IDs exists in the table, the existing entry is overwritten.
eCLD_ScenesStore(): This function can be used to save the currently implemented attribute values on the device to a scene in the Scene table on the specified local endpoint. A scene ID and an associated group ID must be specified (the latter must be set to 0x0000 if there is no group association). If a scene with these IDs exists in the table, the existing entry is overwritten except for the transition time and scene name fields.
Parent topic:Issuing Local Commands
Applying a Scene
An existing scene can be applied on the local node using the function eCLD_ScenesRecall(). This function reads the stored attribute values for the specified scene from the local Scene table and implements them on the device. The values of any attributes that are not included in the scene remain unchanged.
Parent topic:Issuing Local Commands
Parent topic:Scenes Cluster
Functions
The following Scenes cluster functions are provided in the NXP implementation of the ZCL:
eCLD_ScenesCreateScenes
teZCL_Status eCLD_ScenesCreateScenes(
tsZCL_ClusterInstance *psClusterInstance,
bool_t bIsServer,
tsZCL_ClusterDefinition *psClusterDefinition,
void *pvEndPointSharedStructPtr,
uint8 *pu8AttributeControlBits,
tsCLD_ScenesCustomDataStructure
*psCustomDataStructure,
tsZCL_EndPointDefinition *psEndPointDefinition);
Description
This function creates an instance of the Scenes cluster on an endpoint. The cluster instance is created on the endpoint which is associated with the supplied tsZCL_ClusterInstance
structure and can act as a server or a client, as specified.
The function should be called when setting up a custom endpoint containing one or more selected clusters (rather than the whole set of clusters supported by a standard ZigBee device). This function creates a Scenes cluster instance on the endpoint, but instances of other clusters may also be created on the same endpoint by calling their corresponding creation functions.
Note: Do not call this function for an endpoint on which a standard ZigBee device is used. In this case, the device and its supported clusters must be registered on the endpoint using the relevant device registration function.
When used, this function must be the first Scenes cluster function called in the application, and must be called after the stack has been started and after the ZCL has been initialized.
On calling this function for the first time, a ‘global scene’ entry is created/reserved in the Scene table. On subsequent calls (for example, following a power-cycle or on waking from sleep), if the scene data is recovered by the application from non-volatile memory before the function is called then there is no reinitialization of the scene data. Note that removing all groups from the device also removes the global scene entry (along with other scene entries) from the Scene table.
The function requires an array to be declared for internal use, which contains one element (of type uint8) for each attribute of the cluster. The array length should therefore equate to the total number of attributes supported by the Scene cluster.
The function initializes the array elements to zero.
Parameters
psClusterInstance: Pointer to structure containing information about the cluster instance to be created (see Section 6.1.16). This structure is updated by the function by initializing individual structure fields.
bIsServer: Type of cluster instance (server or client) to be created:
TRUE - server
FALSE - client
psClusterDefinition: Pointer to structure indicating the type of cluster to be created (see Section 6.1.2). In this case, this structure must contain the details of the Scenes cluster. This parameter can refer to a pre-filled structure called
sCLD_Scenes
which is provided in the Scenes.h file.pvEndPointSharedStructPtr: Pointer to the shared structure used for attribute storage. This parameter should be the address of the structure of type
tsCLD_Scenes
which defines the attributes of Scenes cluster. The function initializes the attributes with default values.pu8AttributeControlBits: Pointer to an array of uint8 values, with one element for each attribute in the cluster (see above).
psCustomDataStructure: Pointer to a structure containing the storage for internal functions of the cluster (see Section 13.7.1)
psEndPointDefinition: Pointer to the ZCL endpoint definition structure for the application (see Section 6.1.1)
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
Parent topic:Functions
eCLD_ScenesAdd
teZCL_Status eCLD_ScenesAdd(
uint8 u8SourceEndPointId,
uint16 u16GroupId,
uint8 u8SceneId);
Description
This function adds a new scene on the specified local endpoint - that is, adds an entry to the Scenes table on the endpoint. The group ID associated with the scene must also be specified (or set to 0x0000 if there is no associated group).
If a scene with the specified scene ID and group ID exists in the table, the existing entry is overwritten (that is, all previous scene data in this entry is lost).
Parameters
u8SourceEndPointId: Number of local endpoint on which Scene table entry is to be added.
u16GroupId: 16-bit group ID/address of associated group (or 0x0000 if no group).
u8SceneId: 8-bit scene ID of new scene.
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
Parent topic:Functions
eCLD_ScenesStore
teZCL_Status eCLD_ScenesStore(
uint8 u8SourceEndPointId,
uint16 u16GroupId,
uint8 u8SceneId);
Description
This function adds a new scene on the specified local endpoint, based on the current cluster attribute values of the device- that is, saves the current attribute values of the device to a new entry of the Scenes table on the endpoint. The group ID associated with the scene must also be specified (or set to 0x0000 if there is no associated group).
If a scene with the specified scene ID and group ID exists in the table, the existing entry is overwritten. The previous scene data in this entry is lost, except for the transition time field and the scene name field - these fields are left unchanged.
Parameters
u8SourceEndPointId: Number of local endpoint on which Scene table entry is to be added.
*u16GroupId:*16-bit group ID/address of associated group (or 0x0000 if no group)
u8SceneId: 8-bit scene ID of scene
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
Parent topic:Functions
eCLD_ScenesRecall
teZCL_Status eCLD_ScenesRecall(
uint8 u8SourceEndPointId,
uint16 u16GroupId,
uint8 u8SceneId);
Description
This function obtains the attribute values (from the extension fields) of the scene with the specified Scene ID and Group ID on the specified (local) endpoint, and sets the corresponding cluster attributes on the device to these values. Thus, the function reads the stored attribute values for a scene and implements them on the device.
Note that the values of any cluster attributes that are not included in the scene remains unchanged.
Parameters
u8SourceEndPointId: Number of local endpoint containing Scene table to be read.
u16GroupId: 16-bit group ID/address of associated group (or 0x0000 if no group)
u8SceneId: 8-bit scene ID of scene to be read.
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
Parent topic:Functions
eCLD_ScenesCommandAddSceneRequestSend
teZCL_Status eCLD_ScenesCommandAddSceneRequestSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_ScenesAddSceneRequestPayload *psPayload);
Description
This function sends an Add Scene command to a remote device in order to add a scene on the specified endpoint - that is, to add an entry to the Scene table on the endpoint. The scene ID is specified in the payload of the message, along with a duration for the scene among other values (see Section 13.7.2). The scene may also be associated with a particular group.
The device receiving this message generates a callback event on the endpoint on which the Scenes cluster is registered and, if possible, add the scene to its Scene table before sending an Add Scene response indicating success or failure (see Section 13.7.3).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the request. The TSN in the response is set to match the TSN in the request, allowing an incoming response to be paired with a request. This is useful when sending more than one request to the same destination endpoint.
Parameters
u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.
u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address types eZCL_AMBOUND and eZCL_AMGROUP.
psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.
psPayload: Pointer to a structure containing the payload for this message (see Section 13.7.2)
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_EP_RANGE
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_CLUSTER_NOT_FOUND
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().
Parent topic:Functions
eCLD_ScenesCommandViewSceneRequestSend
teZCL_Status eCLD_ScenesCommandViewSceneRequestSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_ScenesViewSceneRequestPayload
*psPayload);
Description
This function sends a View Scene command to a remote device, requesting information on a particular scene on the destination endpoint. The relevant scene ID is specified in the command payload. Note that this command can only be sent to an individual device/endpoint and not to a group address.
The device receiving this message generates a callback event on the endpoint on which the Scenes cluster was registered and generates a View Scene response containing the relevant information (see Section 13.7.3).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the request. The TSN in the response is set to match the TSN in the request, allowing an incoming response to be paired with a request. This is useful when sending more than one request to the same destination endpoint.
Parameters
u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.
u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address type eZCL_AMBOUND.
psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.
psPayload: Pointer to a structure containing the payload for this message (see Section 13.7.2)
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_EP_RANGE
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_CLUSTER_NOT_FOUND
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().
Parent topic:Functions
eCLD_ScenesCommandRemoveSceneRequestSend
teZCL_Status eCLD_ScenesCommandRemoveSceneRequestSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_ScenesRemoveSceneRequestPayload
*psPayload);
Description
This function sends a Remove Scene command to request that the target device deletes membership of the destination endpoint from a particular scene - that is, remove the scene from the Scene table. The relevant scene ID is specified in the payload of the message. The scene may also be associated with a particular group.
The device receiving this message generates a callback event on the endpoint on which the Scenes cluster was registered. The device then deletes the scene in the Scene table. If the request was sent to a single device (rather than to a group address), it then generates an appropriate Remove Scene response indicating success, or failure (see Section 13.7.3).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the request. The TSN in the response is set to match the TSN in the request, allowing an incoming response to be paired with a request. This is useful when sending more than one request to the same destination endpoint.
Parameters
u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.
u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address types eZCL_AMBOUND and eZCL_AMGROUP.
psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.
psPayload: Pointer to a structure containing the payload for this message (see Section 13.7.2).
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_EP_RANGE
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_CLUSTER_NOT_FOUND
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().
Parent topic:Functions
eCLD_ScenesCommandRemoveAllScenesRequestSend
teZCL_Status eCLD_ScenesCommandRemoveAllScenesRequestSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_ScenesRemoveAllScenesRequestPayload
Description
This function sends a Remove All Scenes command to request that the target device deletes all entries corresponding to the specified group ID/address in its Scene table. The relevant group ID is specified in the payload of the message. Note that specifying a group ID of 0x0000 removes all scenes not associated with a group.
The device receiving this message generates a callback event on the endpoint on which the Scenes cluster was registered. The device then deletes the scenes in the Scene table. If the request is sent to a single device (rather than to a group address), it then generates an appropriate Remove All Scenes response indicating success, or failure (see Section 13.7.3).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the request. The TSN in the response is set to match the TSN in the request, allowing an incoming response to be paired with a request. This is useful when sending more than one request to the same destination endpoint.
Parameters
u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.
u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address types eZCL_AMBOUND and eZCL_AMGROUP.
psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.
psPayload: Pointer to a structure containing the payload for this message (see Section 13.7.2).
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_EP_RANGE
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_CLUSTER_NOT_FOUND
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().
Parent topic:Functions
eCLD_ScenesCommandStoreSceneRequestSend
teZCL_Status eCLD_ScenesCommandStoreSceneRequestSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_ScenesStoreSceneRequestPayload
*psPayload);
Description
This function sends a Store Scene command to request that the target device saves the current settings of all other clusters on the device as a scene - that is, adds a scene containing the current cluster settings to the Scene table. The entry is stored using the scene ID and group ID specified in the payload of the command. If an entry exists with these IDs, its existing cluster settings are overwritten with the new settings.
Note that this command does not set the transition time and scene name fields (or for a new entry, they are set to null values). If this command is to create a new scene that requires particular settings for these fields, Add Group command should be used. The scene entry must be created in advance using the Add Group command, and the fields transition time and scene name should be pre-configured.
The device receiving this message generates a callback event on the endpoint on which the Scenes cluster was registered. If the request is sent to a single device (rather than to a group address), it then generates an appropriate Store Scene response indicating success, or failure (see Section 13.7.3).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the request. The TSN in the response is set to match the TSN in the request, allowing an incoming response to be paired with a request. This is useful when sending more than one request to the same destination endpoint.
Parameters
u8SourceEndPointId: ID or number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.
u8DestinationEndPointId: ID or number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address types eZCL_AMBOUND and eZCL_AMGROUP.
psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.
psPayload: Pointer to a structure containing the payload for this message (see Section 13.7.2).
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_EP_RANGE
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_CLUSTER_NOT_FOUND
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_F
If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().
Parent topic:Functions
eCLD_ScenesCommandRecallSceneRequestSend
teZCL_Status eCLD_ScenesCommandRecallSceneRequestSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_ScenesRecallSceneRequestPayload
*psPayload);
Description
This function sends a Recall Scene command to request that the target device retrieves and implements the settings of the specified scene - that is, reads the scene settings from the Scene table and applies them to the other clusters on the device. The required scene ID and group ID are specified in the payload of the command.
Note that if the specified scene entry does not contain any settings for a particular cluster or there are some missing attribute values for a cluster, these attribute values remains unchanged in the implementation of the cluster.
The device receiving this message generates a callback event on the endpoint on which the Scenes cluster was registered. If the request is sent to a single device (rather than to a group address), it then generates an appropriate Recall Scene response indicating success, or failure (see Section 13.7.3).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the request. The TSN in the response is set to match the TSN in the request, allowing an incoming response to be paired with a request. This is useful when sending more than one request to the same destination endpoint.
Parameters
u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.
u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address types eZCL_AMBOUND and eZCL_AMGROUP.
psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.
psPayload: Pointer to a structure containing the payload for this message (see Section 13.7.2).
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_EP_RANGE
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_CLUSTER_NOT_FOUND
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().
Parent topic:Functions
eCLD_ScenesCommandGetSceneMembershipRequestSend
teZCL_Status eCLD_ScenesCommandGetSceneMembershipRequestSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_ScenesGetSceneMembershipRequestPayload
*psPayload);
Description
This function sends a Get Scene Membership to inquire which scenes are associated with a specified group ID on a device. The relevant group ID is specified in the payload of the command.
The device receiving this message generates a callback event on the endpoint on which the Scenes cluster is registered. If the request is sent to a single device (rather than to a group address), it then generates an appropriate Get Scene Membership response indicating success or failure and, if successful, the response contains a list of the scene IDs associated with the given group ID (see Section 13.7.3). If the original command is sent to a group address, an individual device only responds if it has scenes associated with the group ID in the command payload (so it only responds if successful).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the request. The TSN in the response is set to match the TSN in the request, allowing an incoming response to be paired with a request. This is useful when sending more than one request to the same destination endpoint.
Parameters
u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.
u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address types eZCL_AMBOUND and eZCL_AMGROUP.
psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.
psPayload: Pointer to a structure containing the payload for this message (see Section 13.7.2).
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_EP_RANGE
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_CLUSTER_NOT_FOUND
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().
Parent topic:Functions
eCLD_ScenesCommandEnhancedAddSceneRequestSend
teZCL_Status eCLD_ScenesCommandEnhancedAddSceneRequestSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_ScenesEnhancedAddSceneRequestPayload
*psPayload);
Description
This function sends an Enhanced Add Scene command to a remote device in order to add a scene on the specified endpoint - that is, to add an entry to the Scene table on the endpoint. The function allows a finer transition time (in tenths of a second rather than seconds) when applying the scene. The scene ID is specified in the payload of the message, along with a duration for the scene and the transition time, among other values (see Section 13.7.2). The scene may also be associated with a particular group.
The device receiving this message generates a callback event on the endpoint on which the Scenes cluster is registered. If possible, add the scene to its Scene table before sending an Enhanced Add Scene response indicating success or failure (see Section 13.7.3).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the request. The TSN in the response is set to match the TSN in the request, allowing an incoming response to be paired with a request. This is useful when sending more than one request to the same destination endpoint.
Parameters
u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.
u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address types eZCL_AMBOUND and eZCL_AMGROUP.
psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.
psPayload: Pointer to a structure containing the payload for this message (see Section 13.7.2).
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_EP_RANGE
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_CLUSTER_NOT_FOUND
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().
Parent topic:Functions
eCLD_ScenesCommandEnhancedViewSceneRequestSend
teZCL_Status eCLD_ScenesCommandEnhancedViewSceneRequestSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_ScenesEnhancedViewSceneRequestPayload
*psPayload);
Description
This function sends an Enhanced View Scene command to a remote device, requesting information on a particular scene on the destination endpoint. The returned information includes the finer transition time configured with the function eCLD_ScenesCommandEnhancedAddSceneRequestSend(). The relevant scene ID is specified in the command payload. Note that this command can only be sent to an individual device/endpoint and not to a group address.
The device receiving this message generates a callback event on the endpoint on which the Scenes cluster was registered and generates an Enhanced View Scene response containing the relevant information (see Section 13.7.3).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the request. The TSN in the response is set to match the TSN in the request, allowing an incoming response to be paired with a request. This is useful when sending more than one request to the same destination endpoint.
Parameters
u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.
u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address type eZCL_AMBOUND.
psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.
psPayload: Pointer to a structure containing the payload for this message (see Section 13.7.2)
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_EP_RANGE
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_CLUSTER_NOT_FOUND
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().
Parent topic:Functions
eCLD_ScenesCommandCopySceneSceneRequestSend
teZCL_Status eCLD_ScenesCommandCopySceneSceneRequestSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_ScenesCopySceneRequestPayload *psPayload);
Description
This function sends a Copy Scene command to a remote device, requesting that the scene settings from one scene ID/group ID combination are copied to another scene ID/group ID combination on the target endpoint. The relevant source and destination scene ID/group ID combinations are specified in the command payload.
Note that:
If the destination scene ID/group ID exists on the target endpoint, the existing scene is overwritten with the new settings.
The message payload contains a ‘copy all scenes’ bit. If the bit is set to ‘1’, it instructs the destination server to copy all scenes in the specified source group to scenes with the same scene IDs in the destination group. In this case, the source and destination scene IDs in the payload are ignored.
The device receiving this message generates a callback event on the endpoint on which the Scenes cluster was registered and, if the original request is unicast, generates a Copy Scene response (see Section 13.7.3).
You are required to provide a pointer to a location to receive a Transaction Sequence Number (TSN) for the request. The TSN in the response is set to match the TSN in the request, allowing an incoming response to be paired with a request. This is useful when sending more than one request to the same destination endpoint.
Parameters
u8SourceEndPointId: Number of the local endpoint through which to send the request. This parameter is used both to send the message and to identify the instance of the shared structure holding the required attribute values.
u8DestinationEndPointId: Number of the endpoint on the remote node to which the request is sent. This parameter is ignored when sending to address type eZCL_AMBOUND.
psDestinationAddress: Pointer to a structure holding the address of the node to which the request is sent.
pu8TransactionSequenceNumber: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request.
psPayload: Pointer to a structure containing the payload for this message (see Section 13.7.2).
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_EP_RANGE
E_ZCL_ERR_EP_UNKNOWN
E_ZCL_ERR_CLUSTER_NOT_FOUND
E_ZCL_ERR_ZBUFFER_FAIL
E_ZCL_ERR_ZTRANSMIT_FAIL
If an error is returned by the ZigBee PRO stack function which is invoked by this function to transmit the data, this error may be obtained by calling eZCL_GetLastZpsError().
Parent topic:Functions
Parent topic:Scenes Cluster
Structures
Custom Data Structure
The Scenes cluster requires extra storage space to be allocated to be used by internal functions. The structure definition for this storage is shown below:
typedef struct
{
DLIST lScenesAllocList;
DLIST lScenesDeAllocList;
tsZCL_ReceiveEventAddress sReceiveEventAddress;
tsZCL_CallBackEvent sCustomCallBackEvent;
tsCLD_ScenesCallBackMessage sCallBackMessage;
tsCLD_ScenesTableEntry
asScenesTableEntry[CLD_SCENES_MAX_NUMBER_OF_SCENES];
} tsCLD_ScenesCustomDataStructure;
The fields are for internal use and no knowledge of them is required.
Parent topic:Structures
Custom Command Payloads
The following structures contain the payloads for the Scenes cluster custom commands.
Add Scene Request Payload
typedef struct
{
uint16 u16GroupId;
uint8 u8SceneId;
uint16 u16TransitionTime;
tsZCL_CharacterString sSceneName;
tsCLD_ScenesExtensionField sExtensionField;
} tsCLD_ScenesAddSceneRequestPayload;
where:
u16GroupId
is the group ID with which the scene is associated (0x0000 if there is no association with a group)u8SceneId
is the ID of the scene to be added to the Scene table (the Scene ID must be unique within the group associated with the scene)u16TransitionTime
is the amount of time, in seconds, that the device takes to switch to this scenesSceneName
is an optional character string (of up to 16 characters) representing the name of the scenesExtensionField
is a structure containing the attribute values of the clusters to which the scene relates
View Scene Request Payload
typedef struct
{
uint16 u16GroupId;
uint8 u8SceneId;
} tsCLD_ScenesViewSceneRequestPayload;
where:
u16GroupId
is the group ID with which the desired scene is associatedu8SceneId
is the scene ID of the scene to be viewed
Remove Scene Request Payload
typedef struct
{
uint16 u16GroupId;
uint8 u8SceneId;
} tsCLD_ScenesRemoveSceneRequestPayload;
where:
u16GroupId
is the group ID with which the relevant scene is associatedu8SceneId
is the scene ID of the scene to be deleted from the Scene table
Remove All Scenes Request Payload
typedef struct
{
uint16 u16GroupId;
} tsCLD_ScenesRemoveAllScenesRequestPayload;
where u16GroupId
is the group ID for which all scenes are to be deleted.
Store Scene Request Payload
typedef struct
{
uint16 u16GroupId;
uint8 u8SceneId;
} tsCLD_ScenesStoreSceneRequestPayload;
where:
u16GroupId
is the group ID with which the relevant scene is associatedu8SceneId
is the scene ID of the scene in which the captured cluster settings are to be stored
Recall Scene Request Payload
typedef struct
{
uint16 u16GroupId;
uint8 u8SceneId;
} tsCLD_ScenesRecallSceneRequestPayload;
where:
u16GroupId
is the group ID with which the relevant scene is associatedu8SceneId
is the scene ID of the scene from which cluster settings are to be retrieved and applied
Get Scene Membership Request Payload
typedef struct
{
uint16 u16GroupId;
} tsCLD_ScenesGetSceneMembershipRequestPayload;
where u16GroupId
is the group ID for which associated scenes are required.
Enhanced Add Scene Request Payload
typedef struct
{
uint16 u16GroupId;
uint8 u8SceneId;
uint16 u16TransitionTime100ms;
tsZCL_CharacterString sSceneName;
tsCLD_ScenesExtensionField sExtensionField;
} tsCLD_ScenesEnhancedAddSceneRequestPayload;
where:
u16GroupId
is the group ID with which the scene is associated (0x0000 if there is no association with a group)u8SceneId
is the ID of the scene to be added to the Scene table (the Scene ID must be unique within the group associated with the scene)u16TransitionTime100ms
is the amount of time, in tenths of a second, that the device takes to switch to this scenesSceneName
is an optional character string (of up to 16 characters) representing the name of the scenesExtensionField
is a structure containing the attribute values of the clusters to which the scene relates
View Scene Request Payload
typedef struct
{
uint16 u16GroupId;
uint8 u8SceneId;
} tsCLD_ScenesEnhancedViewSceneRequestPayload;
where:
u16GroupId
is the group ID with which the desired scene is associatedu8SceneId
is the scene ID of the scene to be viewed
Copy Scene Request Payload
typedef struct
{
uint8 u8Mode;
uint16 u16FromGroupId;
uint8 u8FromSceneId;
uint16 u16ToGroupId;
uint8 u8ToSceneId;
} tsCLD_ScenesCopySceneRequestPayload;
where:
u8Mode
is a bitmap indicating the required copying mode (only bit 0 is used):If bit 0 is set to ‘1’, then ‘copy all scenes’ mode is used, in which all scenes associated with the source group are duplicated for the destination group (and the scene ID fields are ignored)
If bit 0 is set to ‘0’, then a single scene is copied
u16FromGroupId
is the source group IDu8FromSceneId
is the source scene ID (ignored for ‘copy all scenes’ mode)u16ToGroupId
is the destination group IDu8ToSceneId
is the destination scene ID (ignored for ‘copy all scenes’ mode)
Parent topic:Structures
Custom Command Responses
The Scenes cluster generates responses to certain custom commands. The responses which contain payloads are detailed below:
Add Scene Response Payload
typedef struct
{
zenum8 eStatus;
uint16 u16GroupId;
uint8 u8SceneId;
} tsCLD_ScenesAddSceneResponsePayload;
where:
eStatus
is the outcome of the Add Scene command (success or invalid)u16GroupId
is the group ID with which the added scene is associatedu8SceneId
is the scene ID of the added scene
View Scene Response Payload
typedef struct
{
zenum8 eStatus;
uint16 u16GroupId;
uint8 u8SceneId;
uint16 u16TransitionTime;
tsZCL_CharacterString sSceneName;
tsCLD_ScenesExtensionField sExtensionField;
} tsCLD_ScenesViewSceneResponsePayload;
where:
eStatus
is the outcome of the View Scene command (success or invalid)u16GroupId
is the group ID with which the viewed scene is associatedu8SceneId
is the scene ID of the viewed sceneu16TransitionTime
is the amount of time, in seconds, that the device takes to switch to the viewed scenesSceneName
is an optional character string (of up to 16 characters) representing the name of the viewed scenesExtensionField
is a structure containing the attribute values of the clusters to which the viewed scene relates
Remove Scene Response Payload
typedef struct
{
zenum8 eStatus;
uint16 u16GroupId;
uint8 u8SceneId;
} tsCLD_ScenesRemoveSceneResponsePayload;
where:
eStatus
is the outcome of the Remove Scene command (success or invalid)u16GroupId
is the group ID with which the removed scene is associatedu8SceneId
is the scene ID of the removed scene
Remove All Scenes Response Payload
typedef struct
{
zenum8 eStatus;
uint16 u16GroupId;
} tsCLD_ScenesRemoveAllScenesResponsePayload;
where:
eStatus
is the outcome of the Remove All Scenes command (success or invalid)u16GroupId
is the group ID with which the removed scenes are associated
Store Scene Response Payload
typedef struct
{
zenum8 eStatus;
uint16 u16GroupId;
uint8 u8SceneId;
} tsCLD_ScenesStoreSceneResponsePayload;
where:
eStatus
is the outcome of the Store Scene command (success or invalid)u16GroupId
is the group ID with which the stored scene is associatedu8SceneId
is the scene ID of the stored scene
Get Scene Membership Response Payload
typedef struct
{
zenum8 eStatus;
uint8 u8Capacity;
uint16 u16GroupId;
uint8 u8SceneCount;
uint8 *pu8SceneList;
} tsCLD_ScenesGetSceneMembershipResponsePayload;
where:
eStatus
is the outcome of the Get Scene Membership command (success or invalid)u8Capacity
is the capacity of the Scene table of the device to receive more scenes - that is, the number of scenes that may be added (special values: 0xFE means that at least one more scene may be added, a higher value means that the remaining capacity of the table is unknown)u16GroupId
is the group ID to which the query relatesu8SceneCount
is the number of scenes in the list of the next fieldpu8SceneList
is a pointer to the returned list of scenes from those queried that exist on the device, where each scene is represented by its scene ID
Enhanced Add Scene Response Payload
typedef struct
{
zenum8 eStatus;
uint16 u16GroupId;
uint8 u8SceneId;
} tsCLD_ScenesEnhancedAddSceneResponsePayload;
where:
eStatus
is the outcome of the Enhanced Add Scene command (success or invalid)u16GroupId
is the group ID with which the added scene is associatedu8SceneId
is the scene ID of the added scene
Enhanced View Scene Response Payload
typedef struct
{
zenum8 eStatus;
uint16 u16GroupId;
uint8 u8SceneId;
uint16 u16TransitionTime;
tsZCL_CharacterString sSceneName;
tsCLD_ScenesExtensionField sExtensionField;
} tsCLD_ScenesEnhancedViewSceneResponsePayload;
where:
eStatus
is the outcome of the Enhanced View Scene command (success or invalid)u16GroupId
is the group ID with which the viewed scene is associatedu8SceneId
is the scene ID of the viewed sceneu16TransitionTime
is the amount of time, in seconds, that the device takes to switch to the viewed scenesSceneName
is an optional character string (of up to 16 characters) representing the name of the viewed scenesExtensionField
is a structure containing the attribute values of the clusters to which the viewed scene relates
Copy Scene Response Payload
typedef struct
{
uint8 u8Status;
uint16 u16FromGroupId;
uint8 u8FromSceneId;
} tsCLD_ScenesCopySceneResponsePayload;
where:
u8Status
is the outcome of the Copy Scene command (success, invalid scene, or insufficient space for new scene)u16FromGroupId
is the source group ID for the copyu8FromSceneId
is the source scene ID for the copy
Parent topic:Structures
Scenes Table Entry
The following structure contains the data for a Scenes table entry (containing a saved scene):
typedef struct
{
DNODE dllScenesNode;
bool bActive;
bool bInTransit;
uint16 u16GroupId;
uint8 u8SceneId;
uint16 u16TransitionTime;
uint32 u32TransitionTimer;
uint8 u8SceneNameLength;
uint8 au8SceneName[CLD_SCENES_MAX_SCENE_NAME_LENGTH + 1];
uint16 u16SceneDataLength;
uint8 au8SceneData[CLD_SCENES_MAX_SCENE_STORAGE_BYTES];
#ifdef CLD_SCENES_TABLE_SUPPORT_TRANSITION_TIME_IN_MS
uint8 u8TransitionTime100ms;
#endif
} tsCLD_ScenesTableEntry;
where:
bActive
is a boolean value indicating whether the scene is active (TRUE) or inactive (FALSE).bInTransit
is a boolean value indicating whether the scene is in a transitional state (TRUE) or a constant active/inactive state (FALSE).u16GroupId
is the identifier of the group to which the scene applies (the value 0x0000 is used to indicate that the scene is not associated with a group).u8SceneId
is the identifier of the scene and must be a unique value within the group with which the scene is associated.u16TransitionTime
is the length of time, in seconds, that the device takes to move from its current state to the scene state.u32TransitionTimer
is the elapsed time, in milliseconds, since the start of a currently active transition to the scene.u8SceneNameLength
is the number of characters in the name of the scene (and therefore the size of the arrayau8SceneName[]
below). The value must not be greater than CLD_SCENES_MAX_SCENE_NAME_LENGTH, which is set in the compile-time options (see Section 13.9).au8SceneName[]
is an array containing the name of the scene, with one ASCII character in each array element. The number of elements in the array must be set inu8SceneNameLength
above.u16SceneDataLength
is the number of items of data for the scene (and therefore the size of the arrayau8SceneData[]
below). The value must not be greater than CLD_SCENES_MAX_SCENE_STORAGE_BYTES, which is set in the compile-time options (see Section 13.9).au8SceneData[]
is an array containing the data for the scene, with one data item in each array element. The data stored is dependent on the cluster to which the scene data applies. The number of elements in the array must be set inu16SceneDataLength
above.u8TransitionTime
100 ms is an optional that allows a fractional part to be added to the transition time (u16TransitionTime
) of the scene. This value represents the number of tenths of a second in the range 0x00 to 0x09.
Parent topic:Structures
Parent topic:Scenes Cluster
Enumerations
teCLD_Scenes_ClusterID
The following structure contains the enumerations used to identify the attributes of the Scenes cluster.
typedef enum
{
E_CLD_SCENES_ATTR_ID_SCENE_COUNT = 0x0000, /* Mandatory */
E_CLD_SCENES_ATTR_ID_CURRENT_SCENE, /* Mandatory */
E_CLD_SCENES_ATTR_ID_CURRENT_GROUP, /* Mandatory */
E_CLD_SCENES_ATTR_ID_SCENE_VALID, /* Mandatory */
E_CLD_SCENES_ATTR_ID_NAME_SUPPORT, /* Mandatory */
E_CLD_SCENES_ATTR_ID_LAST_CONFIGURED_BY /* Optional */
} teCLD_Scenes_ClusterID;
Parent topic:Enumerations
Parent topic:Scenes Cluster
Compile-time options
To enable the Scenes cluster in the code to be built, it is necessary to add the following to the zcl_options.h file:
#define CLD_SCENES
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 SCENES_CLIENT
#define SCENES_SERVER
The Scenes cluster contains macros that may be optionally specified at compile time by adding some or all the following lines to the zcl_options.h file.
To enable the optional Last Configured By attribute, add this line:
#define CLD_SCENES_ATTR_LAST_CONFIGURED_BY
To configure the maximum length of the Scene Name storage, add this line:
#define CLD_SCENES_MAX_SCENE_NAME_LENGTH (16)
To configure the maximum number of scenes, add this line:
#define CLD_SCENES_MAX_NUMBER_OF_SCENES (16)
To configure the maximum number of bytes available for scene storage, add this line:
#define CLD_SCENES_MAX_SCENE_STORAGE_BYTES (20)
To enable the Enhanced Add Scene command, add this line:
#define CLD_SCENES_CMD_ENHANCED_ADD_SCENE
To enable the Enhanced View Scene command, add this line:
#define CLD_SCENES_CMD_ENHANCED_VIEW_SCENE
To enable the Copy Scene command, add this line:
#define CLD_SCENES_CMD_COPY_SCENE
To enable TransitionTime100ms in Scene tables, add this line:
#define CLD_SCENES_TABLE_SUPPORT_TRANSITION_TIME_IN_MS
To define the value (n) of the Cluster Revision attribute, add this line:
#define CLD_SCENES_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).
Parent topic:Scenes Cluster