TI ZigBee協議棧中終端裝置的狀態切換詳解
轉載自:http://www.deyisupport.com/question_answer/wireless_connectivity/zigbee/f/104/t/104629.aspx
本文主要介紹了TI ZigBee協議棧Z-Stack中,關於終端裝置End Device工作過程中,不同狀態之間切換的詳細說明,並且通過分析空中互動的資料包進一步瞭解TI ZigBee協議棧Z-Stack的工作流程。
- 終端裝置在協議棧中涉及到的狀態
在Z-Stack Home 1.2.2a協議棧的C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Components\stack\zdo\ZDApp.h檔案中有定義裝置的不同狀態,分別如下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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_SEC_REJOIN_CURR_CHANNEL,
//
ReJoining a PAN in secure mode scanning in current channel, 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..
DEV_NWK_KA,
//
Device is sending KeepAlive message to its parent
DEV_NWK_BACKOFF,
//
Device is waiting before trying to rejoin
DEV_NWK_SEC_REJOIN_ALL_CHANNEL,
//
ReJoining a PAN in secure mode scanning in all channels, only for end devices
DEV_NWK_TC_REJOIN_CURR_CHANNEL,
//
ReJoining a PAN in Trust center mode scanning in current channel, only for end devices
DEV_NWK_TC_REJOIN_ALL_CHANNEL
//
ReJoining a PAN in Trust center mode scanning in all channels, only for end devices
}
devStates_t;
|
對於不同的裝置型別會有不同的裝置狀態,那麼對於終端裝置來說可能使用到的裝置如下。
?1 2 3 4 5 6 7 8 9 10 11 12 |
DEV_HOLD,
|