ZCL_GetNextElement Function

C

ZCL_Status_t ZCL_GetNextElement(ZCL_NextElement_t *element);

Description

Gets an element from the incoming command's payload

The function is used to simplify processing of responses fo general attributes related commands. Such command may return information concerning several attributes in a single frame. This function reads the next portion of information from the response payload.

To use the function configure an instance of ZCL_NextElement type. The \c element->payload field should be set to the response payload, the \c element->payloadLength to the reponse payload's length, and the \c element->id field to the ID of the response. After calling this function, the \c element->content field may be casted to the appropriate response type (depending on the command's type); for example, for read attributes response it is ZCL_ReadAttributeResp_t.

Parameters

ParamDescription
elementinformation about payload and element status of the operation:
::ZCL_SUCCESS_STATUSan element has been read successfully, more elements are contained in the payload \n
::ZCL_END_PAYLOAD_REACHED_STATUS (0xFD)an element has been read successfully and no more elements are left in the payload \n
::ZCL_INVALID_PARAMETER_STATUS (0xFF)the argument is NULL

Returns

None