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_tsAfDataIndEvent- see Section 8.2.2.3.

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_tsAfDataConfEvent- see Section 8.2.2.4.

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_tsAfDataAckEvent- see Section 8.2.2.5.

ZPS_EVENT_NWK_STARTED

Indicates that network has started on Coordinator. This is reported through the structure ZPS_tsAfNwkFormationEvent- see Section 8.2.2.6. ‘Permit joining’ state is set as specified in APL data 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_tsAfNwkJoinedEvent- see Section 8.2.2.7.

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_tsAfNwkJoinedEvent- see Section 8.2.2.7.

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_tsAfNwkJoinFailedEvent- see Section 8.2.2.8

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_tsAfNwkJoinIndEvent- see Section 8.2.2.10.

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_tsAfNwkDiscoveryEvent- see Section 8.2.2.9. This event (and associated structure) is generated for each network detected.

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_tsAfNwkLeaveIndEvent- see Section 8.2.2.11.

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_tsAfNwkLeaveConfEvent- see Section 8.2.2.12.

ZPS_EVENT_NWK_STATUS_INDICATION

Reports network status event from a remote or local node through the structure ZPS_tsAfNwkStatusIndEvent- see Section 8.2.2.13.

ZPS_EVENT_NWK_ROUTE_DISCOVERY_CONFIRM

Indicates that a route discovery has been performed. The results are reported in the structure ZPS_tsAfNwkRouteDiscoveryConfEvent- see Section8.2.2.14.

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_tsAfPollConfEvent- see Section8.2.2.15.

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_tsAfNwkEdScanConfEvent- see Section 8.2.2.16.

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_tsAfZdoBindEvent- see Section 8.2.2.18.

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_tsAfZdoUnbindEvent- see Section 8.2.2.19.

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_tsAfZdoLinkKeyEvent- see Section 8.2.2.20.

ZPS_EVENT_BIND_REQUEST_SERVER

Indicates the results of a bound data transmission. The results are reported through the structure ZPS_tsAfBindRequestServerEvent- see Section 8.2.2.21.

ZPS_EVENT_ERROR

Indicates that an error has occurred on the local node. The nature of the error is reported through the structure ZPS_tsAfErrorEvent- see Section 8.2.2.17.

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_tsAfInterPanDataIndEvent- see Section 8.2.2.22.

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_tsAfInterPanDataConfEvent- see Section 8.2.2.23.

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_tsAfTCstatusEvent- see Section 8.2.2.24.

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