Error Handling
This chapter describes the error handling provision in the NXP implementation of the ZCL.
Last Stack Error
The last error generated by the ZigBee PRO stack can be obtained using the ZCL function eZCL_GetLastZpsError(), described in Section 5.1. The possible returned errors are listed in the Return/Status Codes chapter of the ZigBee 3.0 Stack User Guide (JNUG3130).
Parent topic:Error Handling
Error/Command Status on Receiving Command
When a device receives a command, an error might be generated. If receiving a command results in an error, an event of the type E_ZCL_CBET_ERROR is generated on the device. In such cases, the following status codes may be used:
The ZCL status of the event (
sZCL_CallBackEvent.eZCL_Status
) is set to one of the error codes detailed in Section 7.2.A ‘default response’ (see Section 6.1.9) may be generated which contains one of the command status codes detailed in Section 7.1.4. This response is sent to the source node of the received command (and can be intercepted using an over-air sniffer).
The table below details the error and command status codes that may be generated.
Error Status (in Event) |
Command Status (in Response) |
Notes |
---|---|---|
E_ZCL_ERR_ZRECEIVE_FAIL * |
None |
A receive error has occurred. This error is often security-based due to key establishment not being successfully completed - ZPS error is ZPS_APL_APS_E_SECURITY_FAIL. |
E_ZCL_ERR_EP_UNKNOWN |
E_ZCL_CMDS_SOFTWARE_FAILURE |
Destination endpoint for the command is not registered with the ZCL. |
E_ZCL_ERR_CLUSTER_NOT_FOUND |
E_ZCL_CMDS_UNSUPPORTED_CLUSTER |
Destination cluster for the command is not registered with the ZCL. |
E_ZCL_ERR_SECURITY_INSUFFICIENT_FOR_CLUSTER |
E_ZCL_CMDS_FAILURE |
Attempt made to access a cluster using a packet without the necessary application-level (APS) encryption. |
None |
E_ZCL_CMDS_UNSUP_GENERAL_COMMAND |
Command has no handler enabled in zcl_options.h file. |
E_ZCL_ERR_CUSTOM_COMMAND_HANDLER_NULL_OR_RETURNED_ERR |
E_ZCL_CMDS_UNSUP_CLUSTER_COMMAND |
Custom command has no registered handler or its handler has not returned E_ZCL_SUCCESS. |
E_ZCL_ERR_KEY_ESTABLISH-MENT_END_POINT_NOT_FOUND |
None |
Key Establishment cluster has not been registered correctly. |
E_ZCL_ERR_KEY_ESTABLISH-MENT_CALLBACK_ERROR |
None |
Key Establishment cluster callback function has returned an error. |
None |
E_ZCL_CMDS_MALFORMED_COMMAND |
A received message is incomplete due to some missing command-specific data. |
* ZigBee PRO stack raises an error which can be retrieved using eZCL_GetLastZpsError().
Parent topic:Error Handling