Structures

Custom Data Structure

The Groups 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                    lGroupsAllocList;
    DLIST                    lGroupsDeAllocList;
    bool                    bIdentifying;
    tsZCL_ReceiveEventAddress    sReceiveEventAddress;
    tsZCL_CallBackEvent          sCustomCallBackEvent;
    tsCLD_GroupsCallBackMessage  sCallBackMessage;
#if (defined CLD_GROUPS) && (defined GROUPS_SERVER)
    tsCLD_GroupTableEntry 
          asGroupTableEntry[CLD_GROUPS_MAX_NUMBER_OF_GROUPS];
#endif
} tsCLD_GroupsCustomDataStructure;

The fields are for internal use and no knowledge of them is required.

However, the structure tsCLD_GroupTableEntry used for the Group table entries is shown in Section 12.6.2.

Parent topic:Structures

Group Table Entry

The following structure contains a Group table entry.

typedef struct
{
    DNODE   dllGroupNode;
    uint16  u16GroupId;
    uint8   au8GroupName[CLD_GROUPS_MAX_GROUP_NAME_LENGTH + 1];
} tsCLD_GroupTableEntry;

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 Groups cluster custom commands.

Add Group Request Payload

typedef struct
{
    zuint16                 u16GroupId;
    tsZCL_CharacterString   sGroupName;
} tsCLD_Groups_AddGroupRequestPayload;

where:

  • u16GroupId is the ID/address of the group to which the endpoints must be added.

  • sGroupName is the name of the group to which the endpoints must be added.

View Group Request Payload

typedef struct
{
    zuint16             u16GroupId;
} tsCLD_Groups_ViewGroupRequestPayload;

where u16GroupId is the ID/address of the group whose name is required

Get Group Membership Request Payload

typedef struct
{
    zuint8             u8GroupCount;
    zint16             *pi16GroupList;
} tsCLD_Groups_GetGroupMembershipRequestPayload;

where:

  • u8GroupCount is the number of groups in the list of the next field.

  • pi16GroupList is a pointer to a list of groups whose memberships are being queried, where each group is represented by its group ID/address.

Remove Group Request Payload

typedef struct
{
    zuint16            u16GroupId;
} tsCLD_Groups_RemoveGroupRequestPayload;

where u16GroupId is the ID/address of the group from which the endpoints must be removed.

Parent topic:Structures

Custom Command Responses

The Groups cluster generates responses to certain custom commands. The responses which contain payloads are detailed below:

Add Group Response Payload

typedef struct
{
    zenum8            eStatus;
    zuint16            u16GroupId;
} tsCLD_Groups_AddGroupResponsePayload;

where:

  • eStatus is the status (success or failure) of the requested group addition.

  • u16GroupId is the ID/address of the group to which endpoints were added.

View Group Response Payload

typedef struct
{
    zenum8                  eStatus;
    zuint16                 u16GroupId;
    tsZCL_CharacterString   sGroupName;
} tsCLD_Groups_ViewGroupResponsePayload;

where:

  • eStatus is the status (success or failure) of the requested operation.

  • u16GroupId is the ID/address of the group whose name was requested.

  • sGroupName is the returned name of the specified group.

Get Group Membership Response Payload

typedef struct
{
    zuint8                  u8Capacity;
    zuint8                  u8GroupCount;
    zint16                 *pi16GroupList;
} tsCLD_Groups_GetGroupMembershipResponsePayload;

where:

  • u8Capacity is the capacity of the Group table of the device to receive more groups - that is, the number of groups that may be added (special values: 0xFE means that at least one additional group may be added, a higher value means that the remaining capacity of the table is unknown).

  • u8GroupCount is the number of groups in the list of the next field.

  • pi16GroupList is a pointer to the returned list of groups from those queried that exist on the device, where each group is represented by its group ID/address.

Remove Group Response Payload

typedef struct
{
    zenum8               eStatus;
    zuint16              u16GroupId;
} tsCLD_Groups_RemoveGroupResponsePayload;

where:

  • eStatus is the status (success or failure) of the requested group modification.

  • u16GroupId is the ID/address of the group from which endpoints were removed.

Parent topic:Structures

Parent topic:Groups Cluster