5.1.7.3.15 ZCL_WriteAttributeValue Function
Syntax
ZCL_Status_t ZCL_WriteAttributeValue(Endpoint_t endpointId, ClusterId_t clusterId,uint8_t clusterSide, ZCL_AttributeId_t attrId, uint8_t attrType, uint8_t *attrValue);
Description
This function finds an attribute in ZCL and rewrites its value by the new one.
The function sets or rewrites only local attributes and impacts attribute reporting when changes occur. To set a new value to an attribute on a remote device, send a write attributes general cluster command via the ZCL_AttributeReq()
function.
Input Parameters
Parameter Name | Description |
---|---|
endpointId | Endpoint where the cluster is registered |
clusterId | Cluster unique identifier |
clusterSide | Detects the cluster’s side (client or server) |
attrId | Attribute unique identifier |
attrType | Type of the attribute to be set |
attrValue | Pointer to attribute value to be set |
Return Type and Values
- The status of the operation:
ZCL_SUCCESS_STATUS (0x00)
– New value is written successfullyZCL_UNSUPPORTED_ATTRIBUTE_STATUS (0x86)
– Does not support the specified attribute is not supportedZCL_INVALID_PARAMETER_STATUS (0xFF)
– NULL is provided as the attribute’s valueZCL_INVALID_DATA_TYPE_STATUS (0x8D)
– The attribute’s type is not the same as specified in the argumentZCL_READ_ONLY_STATUS (0x88)
– Cannot change the value of the attribute because the attribute is read-only