在nwk_globals.h中修改如下的代碼:
三種網絡模式,星型,樹型,和網狀 // Controls the operational mode of network
#define NWK_MODE_STAR 0
#define NWK_MODE_TREE 1
#define NWK_MODE_MESH 2 兩種安全模式 // Controls the security mode of network
#define SECURITY_RESIDENTIAL 0//一般住宅安全模式
#define SECURITY_COMMERCIAL 1//商業安全模式 四種協議棧的PROFILE_ID // Controls various stack parameter settings
#define NETWORK_SPECIFIC 0//特定網絡
#define HOME_CONTROLS 1//家庭控制
#define ZIGBEEPRO_PROFILE 2//zigbee專業版
#define GENERIC_STAR 3//一般星型網絡
#define GENERIC_TREE 4//一般樹型網絡 #define STACK_PROFILE_ID HOME_CONTROLS//STACK_PROFILE_ID的修改可以改變拓撲類型, //此狀態下默認為網狀網絡 #if ( STACK_PROFILE_ID == HOME_CONTROLS )//如果為網狀網絡
#define MAX_NODE_DEPTH 5//最大深度5
#define NWK_MODE NWK_MODE_MESH//網絡模式MESH
#define SECURITY_MODE SECURITY_RESIDENTIAL//安全模式。一般住宅模式
#if ( SECURE != 0 )
#define USE_NWK_SECURITY 1 // true or false,使用網絡安全
#define SECURITY_LEVEL 5//安全等級
#else
#define USE_NWK_SECURITY 0 // true or false 不使用網絡安全
#define SECURITY_LEVEL 0 //安全等級
#endif #elif ( STACK_PROFILE_ID == GENERIC_STAR )//如果為一般星型網絡
#define MAX_NODE_DEPTH 5//結點深度5
#define NWK_MODE NWK_MODE_STAR//網絡模式,星型
#define SECURITY_MODE SECURITY_RESIDENTIAL//安全模式,住宅模式
#if ( SECURE != 0 )
#define USE_NWK_SECURITY 1 // true or false 使用網絡安全
#define SECURITY_LEVEL 5//安全等級5
#else
#define USE_NWK_SECURITY 0 // true or false 不使用網絡安全
#define SECURITY_LEVEL 0//安全等級0
#endif #elif ( STACK_PROFILE_ID == NETWORK_SPECIFIC )//如果為特定網絡
// define your own stack profile settings
#define MAX_NODE_DEPTH 5//結點深度5
#define NWK_MODE NWK_MODE_MESH//網絡模式,MESH
#define SECURITY_MODE SECURITY_RESIDENTIAL //安全模式,一般住宅模式
#if ( SECURE != 0 )
#define USE_NWK_SECURITY 1 // true or false 使用網絡安全
#define SECURITY_LEVEL 5//安全等級5
#else
#define USE_NWK_SECURITY 0 // true or false 不使用網絡安全
#define SECURITY_LEVEL 0//安全等級0
#endif
#endif
|