ZCL_CommandReq Function

C

void ZCL_CommandReq(ZCL_Request_t *req);

Description

Sends a cluster-specific command

The function sends a general cluster specific command. The command's type is recognized according to the \c req->id field. Commands' IDs are defined in clusters' definition files, which also contain all definition related to a particular cluster.

In addition to addressing information and command's ID, eesential fields of the request parameters include the payload and the payload length. The payload for each command is defined as a structure in the cluster's definition file. The pointer to a properly configured instance of the command's payload shall be assigned to the \c req->requestPayload field.

The callback function specified in the \c req->ZCL_Notify field is called to indicate the status of the command's delivery (not a specific response for the command). If acknowledgment of the command's delivery is received the success status is reported in the callback.

A specific response to the command is processed by a special indication function registered for the command. If a command does not imply a specific response the default response may be requested (to indicate that the command has been executed). To request the default response set the \c req->defaultResponse field to -ZCL_FRAME_CONTROL_ENABLE_DEFAULT_RESPONSE. To disable default response set \c req->defaultResponse to -ZCL_FRAME_CONTROL_DISABLE_DEFAULT_RESPONSE.

Response statuses: The ZCL_Notify_t-status field of the callback function specified in the \c req->ZCL_Notify field reports the status of command's transmission and acknowledgement

-ZCL_SUCCESS_STATUS (0x00) - the command has been sent successfully and the

acknowledgement has been received

-ZCL_INSUFFICIENT_SPACE_STATUS (0x89) - the ZCL buffer is not big enough

to hold the request's payload

Error codes - all status codes returned by the APS_DataReq() function.

Parameters

ParamDescription
reqcontains request descriptor

Returns

None