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