5.1.7.3.6 ZCL_GetNextElement Function

Syntax

ZCL_Status_t ZCL_GetNextElement(ZCL_NextElement_t *element);

Description

This function gets an element from the incoming command’s payload.

This function enables the processing of responses for commands related to general attributes. Such commands can deliver data for multiple attributes in a single frame. The function proceeds to read the next data segment from the response payload.

To employ this function, initialize an instance of the ZCL_NextElement type. Set the response payload to the element->payload field, the response payload’s length to the element->payloadLength field and the response ID to the element->id field. After executing this function, the element->content field must be cast to the relevant response type, which varies according to the command type. For example, for a read attributes response, cast to ZCL_ReadAttributeResp_t.

Input Parameters
Parameter NameDescription
elementInformation about payload and element status of the operation
ZCL_SUCCESS_STATUSThe system successfully reads an element, and the payload contains more elements.
ZCL_END_PAYLOAD_REACHED_STATUS (0xFD)The system successfully reads an element, and no more elements are left in the payload.
ZCL_INVALID_PARAMETER_STATUS (0xFF)The argument is NULL.
Return Type and Values
  • Pointer to next cluster descriptor