Alarms Cluster
This chapter describes the Alarms cluster which is defined in the ZCL.
The Alarms cluster has a Cluster ID of 0x0009.
Overview
The Alarms cluster is used to configure alarm functionality on a device and send alarm notifications to other devices.
Note: The Alarms cluster is used with other clusters that use alarms. Alarms conditions and codes are cluster-specific and defined in these clusters.
To use the functionality of this cluster, you must include the file Alarms.h in your application and enable the cluster by defining CLD_ALARMS in the zcl_options.h file.
An Alarms cluster instance can act as a client or a server. The inclusion of the client or server software must be pre-defined in the application’s compile-time options (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 Alarms cluster are fully detailed in Section 17.9.
The Alarms cluster server resides on a device on which other clusters may generate alarm conditions (for example, a cluster attribute value exceeds a certain limit). When an alarm condition occurs, the Alarms cluster server may send an Alarm notification to a cluster client - for example, the client may be on a device that signals alarms to the user. An Alarms cluster client may also contain a user interface (for example, a set of buttons) which allows user instructions to be sent to the server - for example, to reset an alarm.
The Alarms cluster server implements alarm logging by keeping a record of the previously generated alarms in an Alarms table. Thus, historic alarm information can be retrieved from the Alarms table. Each entry of the table contains the following information about one alarm activation:
Alarm code which identifies the type of alarm (this type is cluster-specific)
Cluster ID of the cluster which generated the alarm
Time-stamp indicating the time (UTC) at which the alarm is generated
A maximum number of Alarms table entries can be set in the compile-time options.
Note: Any device which implements time-stamping for alarms must also employ the Time cluster, described in Chapter 17.
Parent topic:Alarms Cluster
Alarms Cluster structure and attributes
The structure definition for the Alarms cluster is shown below.
typedef struct
{
#ifdef ALARMS_SERVER
#ifdef CLD_ALARMS_ATTR_ALARM_COUNT
zuint16 u16AlarmCount;
#endif
#endif
zuint16 u16ClusterRevision;
} tsCLD_Alarms;
where:
u``16AlarmCount
is an optional attribute which contains the number of entries currently in the Alarms table on the cluster server.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:Alarms Cluster
Initialization
The function eCLD_AlarmsCreateAlarms() is used to create an instance of the Alarms cluster. The function is generally called by the initialization function for the host device.
Parent topic:Alarms Cluster
Alarm Operations
This section describes the main operations that are performed using the Alarms cluster - raising an alarm and clearing/resetting an alarm.
Raising an Alarm
An alarm is raised when an alarm condition occurs on a cluster on the same endpoint as the Alarms cluster server - for example, when a cluster attribute falls below a lower threshold. The Alarms cluster server should then send an Alarm notification to any remote Alarms cluster clients that might be interested in the alarm. The server application can send this notification and add an entry to the Alarms table by calling the eCLD_AlarmsSignalAlarm() function. On arriving at a destination device, the notification causes an E_CLD_ALARMS_CMD_ALARM event to be generated to notify the client application.
Parent topic:Alarm Operations
Resetting Alarms (from Client)
A client application can remotely request one alarm or all alarms to be reset:
The function eCLD_AlarmsCommandResetAlarmCommandSend() can be used to request an individual alarm to be reset. A Reset Alarm command is sent to the cluster server. On arriving at the destination device, the command causes an E_CLD_ALARMS_CMD_RESET_ALARM event to be generated.
The function eCLD_AlarmsCommandResetAllAlarmsCommandSend() can be used to request all alarms to be reset. A Reset All Alarms command is sent to the cluster server. On arriving at the destination device, the command causes an E_CLD_ALARMS_CMD_RESET_ALL_ALARMS event to be generated.
On the generation of the above events on the cluster server, the server application can remove the relevant entry or entries from the local Alarms table as described in Section 17.4.2.
Note: The client application can also request that all the entries in an Alarms table are removed by calling eCLD_AlarmsCommandResetAlarmLogCommandSend(). In this case, the entries are automatically deleted by the ZCL on the server.
Parent topic:Alarm Operations
Parent topic:Alarms Cluster
Alarms Events
The Alarms cluster has its own events that are handled through the callback mechanism outlined in Chapter 3. If a device uses the Alarms cluster, then Alarms event handling must be included in the callback function for the associated endpoint, where this callback function is registered through the relevant endpoint registration function (for example, through eHA_RegisterThermostatEndPoint() for a Thermostat device). The relevant callback function is then invoked when an Alarms event occurs.
For an Alarms event, the eEventType
field of the tsZCL_CallBackEvent
structure is set to E_ZCL_CBET_CLUSTER_CUSTOM. This event structure also contains an element sClusterCustomMessage
, which is itself a structure containing a field pvCustomData
. This field is a pointer to the following tsCLD_AlarmsCallBackMessage
structure:
typedef struct
{
uint8 u8CommandId;
union
{
tsCLD_AlarmsResetAlarmCommandPayload *psResetAlarmCommandPayload;
tsCLD_AlarmsAlarmCommandPayload *psAlarmCommandPayload;
tsCLD_AlarmsGetAlarmResponsePayload *psGetAlarmResponse;
} uMessage;
} tsCLD_AlarmsCallBackMessage;
When an Alarms event occurs, one of a number of command types could have been received. The relevant command type is specified through the u8CommandId
field of the tsCLD_AlarmsCallBackMessage
structure. The possible command types are detailed below.
The table below lists and describes the command types that can be received by the cluster server.
u8CommandId Enumeration |
Description |
---|---|
E_CLD_ALARMS_CMD_RESET_ALARM |
A Reset Alarm command has been received |
E_CLD_ALARMS_CMD_RESET_ALL_ALARMS |
A Reset All Alarms command has been received |
E_CLD_ALARMS_CMD_GET_ALARM |
A Get Alarm command has been received |
E_CLD_ALARMS_CMD_RESET_ALARM_LOG |
A Reset Alarm Log command has been received |
The table below lists and describes the command types that can be received by the cluster client.
u8CommandId Enumeration |
Description |
---|---|
E_CLD_ALARMS_CMD_ALARM |
An Alarm notification has been received |
E_CLD_ALARMS_CMD_GET_ALARM_RESPONSE |
A Get Alarm response has been received |
Parent topic:Alarms Cluster
Functions
The following Alarms cluster functions are provided in the NXP implementation of the ZCL:
eCLD_AlarmsCreateAlarms
teZCL_Status eCLD_AlarmsCreateAlarms(
tsZCL_ClusterInstance *psClusterInstance,
bool_t bIsServer,
tsZCL_ClusterDefinition *psClusterDefinition,
void *pvEndPointSharedStructPtr,
uint8 *pu8AttributeControlBits,
tsCLD_AlarmsCustomDataStructure
*psCustomDataStructure);
Description
This function creates an instance of the Alarms 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 is only 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 an Alarms 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: This function is not called 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 Alarms cluster function called in the application, and must be called after the stack has been started and after the ZCL has been initialized.
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 Alarms cluster. This parameter can refer to a pre-filled structure called
sCLD_``Alarms
which is provided in the Alarms.h file.pvEndPointSharedStructPtr: Pointer to the shared structure used for attribute storage. This parameter should be the address of the structure of type
tsCLD_Alarms
which defines the attributes of Alarms 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 17.7.2)
Returns
E_ZCL_SUCCESS
E_ZCL_ERR_PARAMETER_NULL
Parent topic:Functions
eCLD_AlarmsCommandResetAlarmCommandSend
teZCL_Status eCLD_AlarmsCommandResetAlarmCommandSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
tsCLD_AlarmsResetAlarmCommandPayload
*psPayload);
Description
This function can be called on an Alarms cluster client to send a Reset Alarm command to a cluster server. This command requests that a specific alarm for a specific cluster is reset. The function may be called as the result of user input. The relevant alarm and cluster ID must be specified in the command payload (see Section 17.7.3.1).
On receiving the command, an E_CLD_ALARMS_CMD_RESET_ALARM event is generated on the cluster server to notify the application.
The function is only used to reset alarms that are not automatically reset when the alarm condition no longer exists.
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
psDestinationAddress: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request
*psPayload: Pointer to a structure containing the payload for the command (see Section 17.7.3.1)
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_AlarmsCommandResetAllAlarmsCommandSend
teZCL_Status eCLD_AlarmsCommandResetAllAlarmsCommandSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber);
Description
This function can be called on an Alarms cluster client to send a Reset All Alarms command to a cluster server. This command requests that all alarms on the server device are reset. The function may be called as the result of user input.
On receiving the command, an E_CLD_ALARMS_CMD_RESET_ALL_ALARMS event is generated on the cluster server to notify the application.
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
psDestinationAddress: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request
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_AlarmsCommandGetAlarmCommandSend
teZCL_Status eCLD_AlarmsCommandGetAlarmCommandSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber);
Description
This function can be used on an Alarms cluster client to send a Get Alarm command to a cluster server. This command requests information on the logged alarm with the earliest timestamp in the device’s Alarms table. As a result of this command, the retrieved entry is also deleted from the table.
The requested information is returned by the server in a Get Alarm response. When this response is received, an E_CLD_ALARMS_CMD_GET_ALARM_RESPONSE event is generated on the client.
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
psDestinationAddress: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request
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_AlarmsCommandResetAlarmLogCommandSend
teZCL_Status eCLD_AlarmsCommandResetAlarmLogCommandSend(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber);
Description
This function can be called on an Alarms cluster client to send a Reset Alarm Log command to a cluster server. This command requests that the Alarms table on the server is cleared of all entries. The function may be called as the result of user input.
On receiving the command, an E_CLD_ALARMS_CMD_RESET_ALARM_LOG event is generated on the cluster server to notify the application but the ZCL automatically clears the Alarms table.
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
psDestinationAddress: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request
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_AlarmsResetAlarmLog
teZCL_Status eCLD_AlarmsResetAlarmLog(
tsZCL_EndPointDefinition *psEndPointDefinition,
tsZCL_ClusterInstance *psClusterInstance);
Description
This function can be called on the Alarms cluster server to clear all entries of the local Alarms table. The function may be called as the result of user input.
Parameters
psEndPointDefinition: Pointer to the ZCL endpoint definition structure for the application (see Section 6.1.1)
psClusterInstance: Pointer to structure containing information about the Alarms cluster instance (see Section 6.1.16)
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_AlarmsAddAlarmToLog
teZCL_Status eCLD_AlarmsAddAlarmToLog(
tsZCL_EndPointDefinition *psEndPointDefinition,
tsZCL_ClusterInstance *psClusterInstance,
uint8 u8AlarmCode,
uint16 u16ClusterId);
Description
This function can be called on the Alarms cluster server to add a new entry to the local Alarms table. The function should be called by the server application when an alarm condition has occurred. The alarm and the cluster which generated it must be specified. A timestamp (UTC) for the alarm is automatically inserted into the entry.
Parameters
psEndPointDefinition: Pointer to the ZCL endpoint definition structure for the application (see Section 6.1.1)
psClusterInstance: Pointer to structure containing information about the Alarms cluster instance (see Section 6.1.16)
u8AlarmCode: Code that identifies the type of alarm to be added
u16ClusterId: Cluster ID of the cluster which generated the alarm
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_AlarmsGetAlarmFromLog
teZCL_Status eCLD_AlarmsGetAlarmFromLog(
tsZCL_EndPointDefinition *psEndPointDefinition,
tsZCL_ClusterInstance *psClusterInstance,
uint8 *pu8AlarmCode,
uint16 *pu16ClusterId,
uint32 *pu32TimeStamp);
Description
This function can be called on the Alarms cluster server to obtain an entry from the local Alarms table. Information on the logged alarm with the earliest timestamp in the device’s Alarms table is returned - pointers to memory locations to receive the retrieved alarm data must be provided. As a result of this command, the retrieved entry is also deleted from the table.
Parameters
psEndPointDefinition: Pointer to the ZCL endpoint definition structure for the application (see Section 6.1.1)
psClusterInstance: Pointer to structure containing information about the Alarms cluster instance (see Section 6.1.16)
pu8AlarmCode: Pointer to location to receive the alarm code which identifies the retrieved alarm type
pu16ClusterId: Pointer to location to receive the Cluster ID of the cluster which generated the alarm
pu32TimeStamp: Pointer to location to receive timestamp (UTC) of the retrieved alarm (a value of 0XFFFFFFFF indicates that no timestamp is available for the alarm)
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_AlarmsSignalAlarm
teZCL_Status eCLD_AlarmsSignalAlarm(
uint8 u8SourceEndPointId,
uint8 u8DestinationEndPointId,
tsZCL_Address *psDestinationAddress,
uint8 *pu8TransactionSequenceNumber,
uint8 u8AlarmCode,
uint16 u16ClusterId);
Description
This function can be called on the Alarms cluster server to send an Alarm notification to a cluster client and add a log entry to the local Alarms table on the server. The function should be called by the server application when an alarm condition has occurred. The alarm and the cluster which generated it must be specified.
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
psDestinationAddress: Pointer to a location to receive the Transaction Sequence Number (TSN) of the request
u8AlarmCode: Code which identifies the type of alarm that has occurred
u16ClusterId: Cluster ID of the cluster which generated the alarm
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:Alarms Cluster
Structures
Event Callback Message Structure
For an Alarms event, the eEventType
field of the tsZCL_CallBackEvent
structure is set to E_ZCL_CBET_CLUSTER_CUSTOM. This event structure also contains an element sClusterCustomMessage
, which is itself a structure containing a field pvCustomData
. This field is a pointer to the following tsCLD_AlarmsCallBackMessage
structure:
typedef struct
{
uint8 u8CommandId;
union
{
tsCLD_AlarmsResetAlarmCommandPayload *psResetAlarmCommandPayload;
tsCLD_AlarmsAlarmCommandPayload *psAlarmCommandPayload;
tsCLD_AlarmsGetAlarmResponsePayload *psGetAlarmResponse;
} uMessage;
} tsCLD_AlarmsCallBackMessage;
where:
u8CommandId
indicates the type of Alarms command that has been received by a cluster server or client, one of:E_CLD_ALARMS_CMD_RESET_ALARM (server event)
E_CLD_ALARMS_CMD_RESET_ALL_ALARMS (server event)
E_CLD_ALARMS_CMD_GET_ALARM (server event)
E_CLD_ALARMS_CMD_RESET_ALARM_LOG (server event)
E_CLD_ALARMS_CMD_ALARM (client event)
E_CLD_ALARMS_CMD_GET_ALARM_RESPONSE (client event)
uMessage
is a union containing the command payload in the following form:psResetAlarmCommandPayload
is a pointer to a structure containing the Reset Alarm command payload - see Section 17.7.3.1psAlarmCommandPayload
is a pointer to a structure containing the Alarm notification payload - see Section 17.7.3.2psGetAlarmResponse
is a pointer to a structure containing the Get Alarm response payload - see Section 17.7.4.1
For further information on the above events, refer to Section 17.5.
Parent topic:Structures
Custom Data Structure
The Alarms cluster requires extra storage space to be allocated for use by internal functions. The structure definition for this storage is shown below:
typedef struct
{
DLIST lAlarmsAllocList;
DLIST lAlarmsDeAllocList;
tsZCL_ReceiveEventAddress sReceiveEventAddress;
tsZCL_CallBackEvent sCustomCallBackEvent;
tsCLD_AlarmsCallBackMessage sCallBackMessage;
tsCLD_AlarmsTableEntry
asAlarmsTableEntry[CLD_ALARMS_MAX_NUMBER_OF_ALARMS];
} tsCLD_AlarmsCustomDataStructure;
The fields are for internal use and no knowledge of them is required.
Parent topic:Structures
Custom Command Payloads
This section contains the structures for the payloads of the Alarms cluster custom commands.
Reset Alarm Command Payload
typedef struct
{
uint8 u8AlarmCode;
uint16 u16ClusterId;
} tsCLD_AlarmsResetAlarmCommandPayload;
where:
u8AlarmCode
is the code which identifies the type of alarm to be reset - these codes are cluster-specificu16ClusterId
is the Cluster ID of the cluster which generates the alarm to be reset
Parent topic:Custom Command Payloads
Alarm Notification Payload
typedef struct
{
uint8 u8AlarmCode;
uint16 u16ClusterId;
} tsCLD_AlarmsAlarmCommandPayload;
where:
u8AlarmCode
is the code which identifies the type of alarm that has been generated - these codes are cluster-specificu16ClusterId
is the Cluster ID of the cluster which generated the alarm
Parent topic:Custom Command Payloads
Parent topic:Structures
Custom Response Payloads
This section contains the structures for the payloads of the Alarms cluster custom responses.
Get Alarm Response Payload
typedef struct
{
uint8 u8Status;
uint8 u8AlarmCode;
uint16 u16ClusterId;
uint32 u32TimeStamp;
} tsCLD_AlarmsGetAlarmResponsePayload;
where:
u8Status
indicates the result of the Get Alarm operation as follows:SUCCESS (0x01): An alarm entry is successfully retrieved from the Alarms table and its details are reported in the remaining fields (below)
NOT_FOUND (0x00): There were no alarm entries to be retrieved from the Alarms table and the remaining fields (below) are empty
u8AlarmCode
is the code which identifies the type of alarm reported - these codes are cluster-specificu16ClusterId
is the Cluster ID of the cluster which generated the alarmu32TimeStamp
is a timestamp representing the time (UTC) at which the alarm was generated (a value of 0XFFFFFFFF indicates that no timestamp is available for the alarm)
Parent topic:Custom Response Payloads
Parent topic:Structures
Alarms Table Entry
The following structure contains the data for an entry of an Alarms table.
typedef struct
{
DNODE dllAlarmsNode;
uint8 u8AlarmCode;
uint16 u16ClusterId;
uint32 u32TimeStamp;
} tsCLD_AlarmsTableEntry;
where:
dllAlarmsNode
is for internal use and no knowledge of it is requiredu8AlarmCode
is the code which identifies the type of alarm - these codes are cluster-specificu16ClusterId
is the Cluster ID of the cluster which generated the alarmu32TimeStamp
is a timestamp representing the time (UTC) at which the alarm was generated (a value of 0XFFFFFFFF indicates that no timestamp is available for the alarm)
Parent topic:Structures
Parent topic:Alarms Cluster
Enumerations
teCLD_Alarms_AttributeID
The following structure contains the enumerations used to identify the attributes of the Alarms cluster.
typedef enum
{
E_CLD_ALARMS_ATTR_ID_ALARM_COUNT = 0x0000,
} teCLD_Alarms_AttributeID;
Parent topic:Enumerations
Parent topic:Alarms Cluster