5.1.7.3.2 ZCL_CommandReq Function
Syntax
void ZCL_CommandReq(ZCL_Request_t *req);
Description
This function sends a cluster-specific command.
The function sends a cluster-specific command, identifying the command type by the req->id
field. The user can define the command IDs within the cluster definition files, which also contain all related definitions for a particular cluster.
In addition to addressing information and the command’s ID, essential fields of the request parameters include the payload and the payload length. The cluster’s definition file defines the payload for each command as a structure. A pointer to a properly configured instance of the command’s payload must be assigned to the req->requestPayload
field.
The callback function, as specified in the req->ZCL_Notify
field, is invoked to signal the status of the command’s delivery; this does not constitute a specific response to the command. If the system receives acknowledgment of the command’s delivery, the callback reports a success status.
A special indication function, registered for the command, processes a specific response to the command. If a command does not necessitate a specific response, a default response can be requested to confirm that the command was executed. To enable the default response, set the req->defaultResponse
field to ZCL_FRAME_CONTROL_ENABLE_DEFAULT_RESPONSE
. To disable the default response, set the req->defaultResponse
to ZCL_FRAME_CONTROL_DISABLE_DEFAULT_RESPONSE
.
The response statuses, accessed via the argument’s ZCL_Notify_t-status
field in the callback function, as specified in the req->ZCL_Notify
field, communicates the status of the command’s transmission and acknowledgment:
ZCL_SUCCESS_STATUS (0x00)
– The system successfully sends the command and receives an acknowledgment.ZCL_INSUFFICIENT_SPACE_STATUS (0x89)
– The ZCL buffer is too small to contain the request’s payload.- Error codes – These encompass all status codes returned by the
APS_DataReq()
function.
Parameter Number | Description |
---|---|
req | Contains request descriptor |
- None