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.1

    • psAlarmCommandPayload is a pointer to a structure containing the Alarm notification payload - see Section 17.7.3.2

    • psGetAlarmResponse 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-specific

  • u16ClusterId 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-specific

  • u16ClusterId 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-specific

  • u16ClusterId is the Cluster ID of the cluster which generated the alarm

  • u32TimeStamp 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 required

  • u8AlarmCode is the code which identifies the type of alarm - these codes are cluster-specific

  • u16ClusterId is the Cluster ID of the cluster which generated the alarm

  • u32TimeStamp 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