当 ZDO_STATE_CHANGE事件发生, SampleApp_NwkState = (devStates_t)(MSGpkt->hdr.status);对应目前的网络状态。ZDApp.h中定义了各种状态
typedef enum
{
DEV_HOLD, // Initialized – not started automatically
DEV_INIT, // Initialized – not connected to anything
DEV_NWK_DISC, // Discovering PAN’s to join
DEV_NWK_JOINING, // Joining a PAN
DEV_NWK_REJOIN, // ReJoining a PAN, only for end devices
DEV_END_DEVICE_UNAUTH, // Joined but not yet authenticated by trust center
DEV_END_DEVICE, // Started as device after authentication
DEV_ROUTER, // Device joined, authenticated and is a router
DEV_COORD_STARTING, // Started as Zigbee Coordinator
DEV_ZB_COORD, // Started as Zigbee Coordinator
DEV_NWK_ORPHAN // Device has lost information about its parent…
} devStates_t;