4.1.7.3 ZCL Generic APIs

ZCL functions related to all clusters: functions for sending general and cluster-specific commands, auxiliary APIs etc.

Functions
void ZCL_RegisterEndpoint (ZCL_DeviceEndpoint_t *endpoint)

Registers an application endpoint.

void ZCL_UnregisterEndpoint (ZCL_DeviceEndpoint_t *endpoint)

Unregisters an application endpoint.

void ZCL_ResetReq (void)Resets the ZCL component.
ZCL_Status_t ZCL_ReadAttributeValue (Endpoint_t endpointId, ClusterId_t clusterId, uint8_t clusterSide, ZCL_AttributeId_t attrId, uint8_t *attrType, uint8_t *attrValue)

Finds an attribute in ZCL and returns its value.

ZCL_Status_t ZCL_WriteAttributeValue (Endpoint_t endpointId, ClusterId_t clusterId, uint8_t clusterSide, ZCL_AttributeId_t attrId, uint8_t attrType, uint8_t *attrValue)

Finds an attribute in ZCL and rewrites its value by the new one.

void ZCL_AttributeReq (ZCL_Request_t *req)

Sends a general ZCL command related to attributes to a remote device.

void ZCL_CommandReq(ZCL_Request_t *req)

Sends a cluster-specific command.

uint16_t ZCL_GetAttributeLength (uint8_t typeId, const uint8_t *value)

This function returns bytes amount of a type by the type's ID.

ZCL_Status_t ZCL_PutNextElement (ZCL_NextElement_t *element)

Adds an element to the outgoing command payload.

ZCL_Status_t ZCL_GetNextElement (ZCL_NextElement_t *element)

Gets an element from the incoming command's payload.

ZCL_Cluster_t * ZCL_GetCluster(Endpoint_t endpointId, ClusterId_t clusterId, uint8_t clusterSide)

Gets cluster descriptor by endpoint id, cluster id.

ZCL_Cluster_t * ZCL_GetNextCluster(ZCL_Cluster_t *cluster)

Get next cluster from the list of cluster descriptors in a registered end point.

ZCL_Status_t

ZCL_SetReportableChange(Endpoint_t endpointId, ClusterId_t clusterId, uint8_t clusterSide, ZCL_AttributeId_t attrId, uint8_t attrType, uint8_t *repChange)

Finds an attribute in ZCL and rewrites its reportable change value by the new one.

void ZCL_StartReporting(void)

Starts attributes reporting if any attributes are configured for reporting by application. Restarts reporting if it was in progress.

ZCL_Status_t ZCL_ReportOnChangeIfNeeded(void *attr)

Sets ReportOnChange feature for reporting an attribute on change and if all conditions to report are met.