Event and Status Codes
This chapter summarizes the event and return/status codes of the ZigBee PRO stack.
Events
The events that can be generated by the ZigBee PRO stack are enumerated in the structure ZPS_teAfEventType
(from the AF API), shown below.
typedef enum {
ZPS_EVENT_NONE, /* 0, 0x00 */
ZPS_EVENT_APS_DATA_INDICATION, /* 1, 0x01 */
ZPS_EVENT_APS_DATA_CONFIRM, /* 2, 0x02 */
ZPS_EVENT_APS_DATA_ACK, /* 3, 0x03 */
ZPS_EVENT_NWK_STARTED, /* 4, 0x04 */
ZPS_EVENT_NWK_JOINED_AS_ROUTER, /* 5, 0x05 */
ZPS_EVENT_NWK_JOINED_AS_ENDDEVICE, /* 6, 0x06 */
ZPS_EVENT_NWK_FAILED_TO_START, /* 7, 0x07 */
ZPS_EVENT_NWK_FAILED_TO_JOIN, /* 8, 0x08 */
ZPS_EVENT_NWK_NEW_NODE_HAS_JOINED, /* 9, 0x09 */
ZPS_EVENT_NWK_DISCOVERY_COMPLETE, /* 10, 0x0a */
ZPS_EVENT_NWK_LEAVE_INDICATION, /* 11, 0x0b */
ZPS_EVENT_NWK_LEAVE_CONFIRM, /* 12, 0x0c */
ZPS_EVENT_NWK_STATUS_INDICATION, /* 13, 0x0d */
ZPS_EVENT_NWK_ROUTE_DISCOVERY_CONFIRM, /* 14, 0x0e */
ZPS_EVENT_NWK_POLL_CONFIRM, /* 15, 0x0f */
ZPS_EVENT_NWK_ED_SCAN, /* 16, 0x10 */
ZPS_EVENT_ZDO_BIND, /* 17, 0x11 */
ZPS_EVENT_ZDO_UNBIND, /* 18, 0x12 */
ZPS_EVENT_ZDO_LINK_KEY, /* 19, 0x13 */
ZPS_EVENT_BIND_REQUEST_SERVER, /* 20, 0x14.*/
ZPS_EVENT_ERROR, /* 21, 0x15 */
ZPS_EVENT_APS_INTERPAN_DATA_INDICATION, /* 22, 0x16 */
ZPS_EVENT_APS_INTERPAN_DATA_CONFIRM, /* 23, 0x17 */
ZPS_EVENT_APS_ZGP_DATA_INDICATION, /* 24, 0x18 */
ZPS_EVENT_APS_ZGP_DATA_CONFIRM, /* 25, 0x19 */
ZPS_EVENT_TC_STATUS, /* 26, 0X1A */
ZPS_EVENT_NWK_DUTYCYCLE_INDICATION, /* 27, 0x1B */
ZPS_EVENT_NWK_FAILED_TO_SELECT_AUX_CHANNEL, /* 28, 0x1C */
ZPS_EVENT_NWK_ROUTE_RECORD_INDICATION, /* 29, 0x1D */
ZPS_EVENT_NWK_FC_OVERFLOW_INDICATION, /* 30, 0x1E */
ZPS_ZCP_EVENT_FAILURE
} ZPS_teAfEventType;
The events in the above structure are outlined in the table below.
Note: The AF structures which contain the data for the above events are detailed in Section 8.2.2, Event Structures .
ZigBee PRO stack Events
Stack Event |
Description |
---|---|
ZPS_EVENT_NONE |
Used as initial value in structure which receives a message collected from a message queue. |
ZPS_EVENT_APS_DATA_INDICATION |
Indicates that data has arrived on the local node. The event provides information about the data packet through the structure |
ZPS_EVENT_APS_DATA_CONFIRM |
Indicates whether a sent data packet has been successfully passed down the stack and has reached the next hop node toward its destination. The results are reported through the structure |
ZPS_EVENT_APS_DATA_ACK |
Indicates that a sent message has reached its destination node. Details of the received acknowledgment are reported through the structure |
ZPS_EVENT_NWK_STARTED |
Indicates that network has started on Coordinator. This is reported through the structure |
ZPS_EVENT_NWK_JOINED_AS_ROUTER |
Indicates that device has successfully joined network - as Router and reports allocated network address through the structure |
ZPS_EVENT_NWK_JOINED_AS_ENDDEVICE |
Indicates that device has successfully joined network as End Device and reports allocated network address through the structure |
ZPS_EVENT_NWK_FAILED_TO_START |
Indicates that network has failed to start on Coordinator. |
ZPS_EVENT_NWK_FAILED_TO_JOIN |
Indicates that device failed to join network. This is reported through the structure |
ZPS_EVENT_NWK_NEW_NODE_HAS_JOINED |
Indicates to Coordinator or Router that new node has joined as child and reports details of new child through the structure |
ZPS_EVENT_NWK_DISCOVERY_COMPLETE |
Indicates that network discovery on Router or End Device has finished and reports details of detected net- work through the structure |
ZPS_EVENT_NWK_LEAVE_INDICATION |
Indicates that a neighboring node has left the network or a remote node has requested the local node to leave. Details are provided through the structure |
ZPS_EVENT_NWK_LEAVE_CONFIRM |
Reports the results of a node leave request issued by the local node. The results are reported through the structure |
ZPS_EVENT_NWK_STATUS_INDICATION |
Reports network status event from a remote or local node through the structure |
ZPS_EVENT_NWK_ROUTE_DISCOVERY_CONFIRM |
Indicates that a route discovery has been performed. The results are reported in the structure |
ZPS_EVENT_NWK_POLL_CONFIRM |
Generated on an End Device to indicate that a poll request submitted to its parent has completed. The outcome of the poll request is indicated through the structure |
ZPS_EVENT_NWK_ED_SCAN |
Indicates that an ‘energy detect’ scan in the 2.4-GHz radio band has completed. The results of the scan are reported through the structure |
ZPS_EVENT_ZDO_BIND |
Indicates that the local node has been successfully bound to one or more remote nodes. The details of the binding are reported through the structure |
ZPS_EVENT_ZDO_UNBIND |
Indicates that the local node has been successfully unbound from one or more remote nodes. The details of the unbinding are reported through the structure |
ZPS_EVENT_ZDO_LINK_KEY |
Indicates that a new application link key has been received and installed, and is ready for use. The details of the link key are reported through the structure |
ZPS_EVENT_BIND_REQUEST_SERVER |
Indicates the results of a bound data transmission. The results are reported through the structure |
ZPS_EVENT_ERROR |
Indicates that an error has occurred on the local node. The nature of the error is reported through the structure |
ZPS_EVENT_APS_INTERPAN_DATA_INDICATION |
Indicates that an inter-PAN communication has arrived (from a node in another network). Details of the inter-PAN communication are reported through the structure |
ZPS_EVENT_APS_INTERPAN_DATA_CONFIRM |
Indicates that an inter-PAN communication (to another network) has been sent by the local node and an acknowledgment has been received from the first hop node (this acknowledgment is not generated in the case of a broadcast). The status of the inter-PAN communication is reported through the structure |
ZPS_EVENT_TC_STATUS |
Indicates whether the negotiation for a link key with the Trust Centre has been successful and, if so, provides the key. These details are provided through the structure |
ZPS_EVENT_NWK_DUTYCYCLE_INDICATION |
Relevant only for Sub Gig. Indicates the duty cycle state. |
ZPS_EVENT_NWK_FAILED_TO_SELECT_AUX_CHANNEL |
Relevant for Sub Gig only. Failure on a multiMAC interface to form a network on the selected channel. |
ZPS_EVENT_NWK_ROUTE_RECORD_INDICATION |
Indicates when a route record is received. |
ZPS_EVENT_NWK_FC_OVERFLOW_INDICATION |
Indicates the overflow of the frame counter when frame counter > 0x80000000. |
Note: Event handling is outlined in “Appendix A”.
Parent topic:Event and Status Codes
Return/Status Codes
The return/status codes that can result from ZigBee PRO API function calls are divided into the following groups:
ZDP codes - see Section 11.2.1
APS codes - see Section 11.2.2
NWK codes - see Section 11.2.3
MAC codes - see Section 11.2.4
Extended error codes - see Section 11.2.5
ZDP codes
The ZDP codes are carried in request and response messages.
ZDP codes
Name |
Value |
Description |
---|---|---|
ZPS_APL_ZDP_E_INV_REQUESTTYPE |
0x80 |
The supplied request type was invalid. |
ZPS_APL_ZDP_E_DEVICE_NOT_FOUND |
0x81 |
The requested device did not exist on a device following a child descriptor request to a parent. |
ZPS_APL_ZDP_E_INVALID_EP |
0x82 |
The supplied endpoint was equal to 0x00 or between 0xF1 and 0xFF. |
ZPS_APL_ZDP_E_NOT_ACTIVE |
0x83 |
The requested endpoint is not described by a Simple descriptor. |
ZPS_APL_ZDP_E_NOT_SUPPORTED |
0x84 |
The requested optional feature is not supported on the target device. |
ZPS_APL_ZDP_E_TIMEOUT |
0x85 |
A timeout has occurred with the requested operation. |
ZPS_APL_ZDP_E_NO_MATCH |
0x86 |
The End Device bind request was unsuccessful due to a failure to match any suitable clusters. |
ZPS_APL_ZDP_E_NO_ENTRY |
0x88 |
The unbind request was unsuccessful due to the Co- ordinator or source device not having an entry in its binding table to unbind. |
ZPS_APL_ZDP_E_NO_DESCRIPTOR |
0x89 |
A child descriptor was not available following a discovery request to a parent. |
ZPS_APL_ZDP_E_INSUFFICIENT_SPACE |
0x8A |
The device does not have storage space to support the requested operation. |
ZPS_APL_ZDP_E_NOT_PERMITTED |
0x8B |
The device is not in the proper state to support the requested operation. |
ZPS_APL_ZDP_E_TABLE_FULL |
0x8C |
The device does not have table space to support the operation. |
ZPS_APL_ZDP_E_NOT_AUTHORIZED |
0x8D |
The permissions configuration table on the target indicates that the request is not authorized from this device. |
Parent topic:Return/Status Codes
APS codes
The APS codes relate to sending/receiving messages.
APS codes
Name |
Value |
Description |
---|---|---|
ZPS_APL_APS_E_ASDU_TOO_LONG |
0xA0 |
A transmit request failed since the ASDU is too large and fragmentation is not supported. |
ZPS_APL_APS_E_DEFRAG_DEFERRED |
0xA1 |
A received fragmented frame could not be defragmented at the current time. |
ZPS_APL_APS_E_DEFRAG_UNSUPPORTED |
0xA2 |
A received fragmented frame could not be defragmented since the device does not support fragmentation. |
ZPS_APL_APS_E_ILLEGAL_REQUEST |
0xA3 |
A parameter value was out of range. |
ZPS_APL_APS_E_INVALID_BINDING |
0xA4 |
An APSME-UNBIND.request failed due to the requested binding link not existing in the binding table. |
ZPS_APL_APS_E_INVALID_GROUP |
0xA5 |
An APSME-REMOVE-GROUP.request has been issued with a group identifier that does not appear in the group table. |
ZPS_APL_APS_E_INVALID_PARAMETER |
0xA6 |
A parameter value was invalid or out of range. |
ZPS_APL_APS_E_NO_ACK |
0xA7 |
An APSDE-DATA.request requesting acknowledged transmission failed due to no acknowledgment being received. |
ZPS_APL_APS_E_NO_BOUND_DEVICE |
0xA8 |
An APSDE-DATA.request with a destination addressing mode set to 0x00 failed due to there being no devices bound to this device. |
ZPS_APL_APS_E_NO_SHORT_ADDRESS |
0xA9 |
An APSDE-DATA.request with a destination addressing mode set to 0x03 failed due to no corresponding short address found in the address map table. |
ZPS_APL_APS_E_NOT_SUPPORTED |
0xAA |
An APSDE-DATA.request with a destination addressing mode set to 0x00 failed due to a binding table not being supported on the device. |
ZPS_APL_APS_E_SECURED_LINK_KEY |
0xAB |
An ASDU was received that was secured using a link key. |
ZPS_APL_APS_E_SECURED_NWK_KEY |
0xAC |
An ASDU was received that was secured using a network key. |
ZPS_APL_APS_E_SECURITY_FAIL |
0xAD |
An APSDE-DATA.request requesting security has resulted in an error during the corresponding security processing. |
ZPS_APL_APS_E_TABLE_FULL |
0xAE |
An APSME-BIND.request or APSME.ADDGROUP.request issued when the binding or group tables, respectively, were full. |
ZPS_APL_APS_E_UNSECURED |
0xAF |
An ASDU was received without any security. |
ZPS_APL_APS_E_UNSUPPORTED_ATTRIBUTE |
0xB0 |
An APSME-GET.request or APSMESET. request has been issued with an unknown attribute identifier. |
Parent topic:Return/Status Codes
NWK codes
The NWK codes come from the NWK layer of the stack and may be returned by any ZigBee PRO API function with a non-void return.
NWK codes
Name |
Value |
Description |
---|---|---|
ZPS_NWK_ENUM_SUCCESS |
0x00 |
Success |
ZPS_NWK_ENUM_INVALID_PARAMETER |
0xC1 |
An invalid or out-of-range parameter has been passed |
ZPS_NWK_ENUM_INVALID_REQUEST |
0xC2 |
Request cannot be processed |
ZPS_NWK_ENUM_NOT_PERMITTED |
0xC3 |
NLME-JOIN.request not permitted |
ZPS_NWK_ENUM_STARTUP_FAILURE |
0xC4 |
NLME-NETWORK-FORMATION.request failed |
ZPS_NWK_ENUM_ALREADY_PRESENT |
0xC5 |
NLME-DIRECT-JOIN.request failure - device already present |
ZPS_NWK_ENUM_SYNC_FAILURE |
0xC6 |
NLME-SYNC.request has failed |
ZPS_NWK_ENUM_NEIGHBOR_TABLE_FULL |
0xC7 |
NLME-DIRECT-JOIN.request failure - no space in Router table |
ZPS_NWK_ENUM_UNKNOWN_DEVICE |
0xC8 |
NLME-LEAVE.request failure - device not in Neighbor table |
ZPS_NWK_ENUM_UNSUPPORTED_ATTRIBUTE |
0xC9 |
NLME-GET/SET.request unknown attribute identifier |
ZPS_NWK_ENUM_NO_NETWORKS |
0xCA |
NLME-JOIN.request detected no networks |
ZPS_NWK_ENUM_RESERVED_1 |
0xCB |
Reserved |
ZPS_NWK_ENUM_MAX_FRM_CTR |
0xCC |
Security processing has failed on outgoing frame due to maximum frame counter |
ZPS_NWK_ENUM_NO_KEY |
0xCD |
Security processing has failed on outgoing frame due to no key |
ZPS_NWK_ENUM_BAD_CCM_OUTPUT |
0xCE |
Security processing has failed on outgoing frame due CCM |
ZPS_NWK_ENUM_NO_ROUTING_CAPACITY |
0xCF |
Attempt at route discovery has failed due to lack of table space |
ZPS_NWK_ENUM_ROUTE_DISCOVERY_FAILED |
0xD0 |
Attempt at route discovery has failed due to any reason except lack of table space |
ZPS_NWK_ENUM_ROUTE_ERROR |
0xD1 |
NLDE-DATA.request has failed due to routing failure on sending device |
ZPS_NWK_ENUM_BT_TABLE_FULL |
0xD2 |
Broadcast or broadcast-mode multicast has failed as there is no room in BTT |
ZPS_NWK_ENUM_FRAME_NOT_BUFFERED |
0xD3 |
Unicast mode multi-cast frame was discarded pending route discovery |
ZPS_NWK_ENUM_FRAME_IS_BUFFERED |
0xD4 |
Unicast frame does not have a route available but it is buffered for automatic resend. |
Parent topic:Return/Status Codes
MAC codes
The MAC codes come from the IEEE 802.15.4 MAC layer of the stack. The MAC codes may be returned by any ZigBee PRO API function with a non-void return. The codes are also described in the IEEE 802.15.4 Stack User Guide (JN-UG-3024).
MAC codes
Name |
Value |
Description |
---|---|---|
MAC_ENUM_SUCCESS |
0x00 |
Success |
MAC_ENUM_BEACON_LOSS |
0xE0 |
Beacon loss after synchronization request |
MAC_ENUM_CHANNEL_ACCESS_FAILURE |
0xE1 |
CSMA/CA channel access failure |
MAC_ENUM_DENIED |
0xE2 |
GTS request denied |
MAC_ENUM_DISABLE_TRX_FAILURE |
0xE3 |
Could not disable transmit or receive |
MAC_ENUM_FAILED_SECURITY_CHECK |
0xE4 |
Incoming frame failed security check |
MAC_ENUM_FRAME_TOO_LONG |
0xE5 |
Frame too long, after security processing, to be sent |
MAC_ENUM_INVALID_GTS |
0xE6 |
GTS transmission failed |
MAC_ENUM_INVALID_HANDLE |
0xE7 |
Purge request failed to find entry in queue |
MAC_ENUM_INVALID_PARAMETER |
0xE8 |
Out-of-range parameter in function |
MAC_ENUM_NO_ACK |
0xE9 |
No acknowledgment received when expected |
MAC_ENUM_NO_BEACON |
0xEA |
Scan failed to find any beacons |
MAC_ENUM_NO_DATA |
0xEB |
No response data after a data request |
MAC_ENUM_NO_SHORT_ADDRESS |
0xEC |
No allocated network (short) address for operation |
MAC_ENUM_OUT_OF_CAP |
0xED |
Receiver-enable request could not be executed, as CAP finished |
MAC_ENUM_PAN_ID_CONFLICT |
0xEE |
PAN ID conflict has been detected |
MAC_ENUM_REALIGNMENT |
0xEF |
Coordinator realignment has been received |
MAC_ENUM_TRANSACTION_EXPIRED |
0xF0 |
Pending transaction has expired and data discarded |
MAC_ENUM_TRANSACTION_OVERFLOW |
0xF1 |
No capacity to store transaction |
MAC_ENUM_TX_ACTIVE |
0xF2 |
Receiver-enable request could not be executed, as in transmit state |
MAC_ENUM_UNAVAILABLE_KEY |
0xF3 |
Appropriate key is not available in ACL |
MAC_ENUM_UNSUPPORTED_ATTRIBUTE |
0xF4 |
PIB Set/Get on unsupported attribute |
Parent topic:Return/Status Codes
Extended error codes
If extended error handling is implemented (see Section 6.7), it provides more detail about the error that led to any one of the following function return codes:
APS codes 0xA3, 0xA6, and 0xAD (see Section 11.2.2).
NWK code 0xC2 (see Section 11.2.3).
The extended error codes, which elaborate on the above codes are provided in the ZPS_teExtendedStatus
enumerations.
Extended error codes
Name |
Value |
Description |
---|---|---|
ZPS_XS_OK |
0x00 |
Success |
ZPS_XS_E_FATAL |
0x01 |
Fatal error - retrying will cause the error again |
ZPS_XS_E_LOOPBACK_BAD_ENDPOINT |
0x02 |
Endpoint is not valid for loopback (fatal error) |
ZPS_XS_E_SIMPLE_DESCRIPTOR_NO_ OUTPUT_CLUSTER |
0x03 |
No output cluster in the Simple descriptor for this endpoint/cluster (fatal error) |
ZPS_XS_E_FRAG_NEEDS_ACK |
0x04 |
Fragmented data requests must be sent with APS ack (fatal error) |
ZPS_XS_E_COMMAND_MANAGER_BAD_ PARAMETER |
0x05 |
Bad parameter has been passed to the command manager (fatal error) |
ZPS_XS_E_INVALID_ADDRESS |
0x06 |
Address parameter is out-of-range (fatal error). For example, broadcast address when calling unicast function |
ZPS_XS_E_INVALID_TX_ACK_FOR_LOCAL_EP |
0x07 |
TX ACK bit has been set when attempting to post to a local endpoint (fatal error) |
ZPS_XS_E_RESOURCE |
0x08 |
Resource error/shortage - retrying may succeed |
ZPS_XS_E_NO_FREE_NPDU |
0x80 |
No free NPDUs (resource error) - the number of NPDUs is set in the “ |
ZPS_XS_E_NO_FREE_APDU |
0x81 |
No free APDUs (resource error) - the number of APDUs is set in the “Instances” property of the appropriate “ |
ZPS_XS_E_NO_FREE_SIM_DATA_REQ |
0x82 |
No free simultaneous data request handles (resource error) - the number of handles is set in the “Maximum Number of Simultaneous Data Requests” field of the “APS layer configuration” section of the ZPS Configuration Editor |
ZPS_XS_E_NO_FREE_APS_ACK |
0x83 |
No free APS acknowledgment handles (resource error) - the number of handles is set in the “Maximum Number of Simultaneous Data Requests with Acks” field of the “APS layer con- figuration” section of the ZPS Configuration Editor |
ZPS_XS_E_NO_FREE_FRAG_RECORD |
0x84 |
No free fragment record handles (resource error)- the number of handles is set in the “Maximum Number of Transmitted Simultaneous Fragmented Messages” field of the “APS layer configuration” section of the ZPS Configuration Editor |
ZPS_XS_E_NO_FREE_MCPS_REQ |
0x85 |
No free MCPS request descriptors (resource error) - there are 8 MCPS request descriptors and these are only ever likely to be exhausted under a very heavy network load or when trying to transmit too many frames too close together |
ZPS_XS_E_NO_FREE_LOOPBACK |
0x86 |
Loopback send is currently busy (resource error)- there can be only one loopback request at a time |
ZPS_XS_E_NO_FREE_EXTENDED_ADDR |
0x87 |
No free entries in the extended address table (resource error) - this table is configured in the ZPS Configuration Editor |
ZPS_XS_E_SIMPLE_DESCRIPTOR_NOT_ FOUND |
0x88 |
Simple descriptor does not exist for this endpoint/ cluster |
ZPS_XS_E_BAD_PARAM_APSDE_REQ_RSP |
0x89 |
Bad parameter has been found while processing an APSDE request or response |
ZPS_XS_E_NO_RT_ENTRY |
0x8a |
No routing table entries free |
ZPS_XS_E_NO_BTR |
0x8b |
No Broadcast transaction table entries free |
ZPS_XS_E_FRAME_COUNTER_ERROR |
0xC0 |
Decryption failed due to frame counter of received frame not greater than stored frame counter. |
ZPS_XS_E_CCM_INVALID_ERROR |
0xC1 |
Decryption failed due to invalid CCM data. |
ZPS_XS_E_UNKNOWN_SRC_ADDR |
0xC2 |
Decryption failed due to unknown source address in the received frame. |
ZPS_XS_E_NO_KEY_DESCRIPTOR |
0xC3 |
Decryption failed due to missing the matching key descriptor. |
ZPS_XS_E_NULL_KEYDESCR |
0xC4 |
Decryption failed due to |
ZPS_XS_E_PDUM_ERROR |
0xC5 |
Decryption failed due to PDUM packet clone failure. |
ZPS_XS_E_NULL_EXT_ADDR |
0xC6 |
Encryption failed due to missing the Extended Address. |
ZPS_XS_E_ENCRYPT_NULL_DESCR |
0xC7 |
Encryption failed due to |
ZPS_XS_E_ENCRYPT_FRAME_COUNTER_FAIL |
0xC8 |
Encryption failed due to frame counter of outgoing frame being invalid. |
ZPS_XS_E_ENCRYPT_DEFAULT |
0xC9 |
Encryption failed due to internal error. |
ZPS_XS_E_FRAME_COUNTER_EXPIRED |
0xCA |
Decryption failed due to frame counter expiration of the received frame. |
Parent topic:Return/Status Codes
Parent topic:Event and Status Codes