標(biāo)題: ZSTACK-2007協(xié)議棧網(wǎng)絡(luò)拓?fù)涞亩x--nwk_globals.h [打印本頁]

作者: shaonv    時間: 2015-1-1 18:49
標(biāo)題: ZSTACK-2007協(xié)議棧網(wǎng)絡(luò)拓?fù)涞亩x--nwk_globals.h
nwk_globals.h中修改如下的代碼:
三種網(wǎng)絡(luò)模式,星型,樹型,和網(wǎng)狀
// 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//商業(yè)安全模式
四種協(xié)議棧的PROFILE_ID
// Controls various stack parameter settings
#define NETWORK_SPECIFIC      0//特定網(wǎng)絡(luò)
#define HOME_CONTROLS         1//家庭控制
#define ZIGBEEPRO_PROFILE     2//zigbee專業(yè)版
#define GENERIC_STAR          3//一般星型網(wǎng)絡(luò)
#define GENERIC_TREE          4//一般樹型網(wǎng)絡(luò)
#define STACK_PROFILE_ID      HOME_CONTROLS//STACK_PROFILE_ID的修改可以改變拓?fù)漕愋停?/font>
//此狀態(tài)下默認(rèn)為網(wǎng)狀網(wǎng)絡(luò)
#if ( STACK_PROFILE_ID == HOME_CONTROLS )//如果為網(wǎng)狀網(wǎng)絡(luò)
    #define MAX_NODE_DEPTH      5//最大深度5
    #define NWK_MODE            NWK_MODE_MESH//網(wǎng)絡(luò)模式MESH
    #define SECURITY_MODE       SECURITY_RESIDENTIAL//安全模式。一般住宅模式
#if   ( SECURE != 0 )
    #define USE_NWK_SECURITY    1   // true or false,使用網(wǎng)絡(luò)安全
    #define SECURITY_LEVEL      5//安全等級
#else
    #define USE_NWK_SECURITY    0   // true or false 不使用網(wǎng)絡(luò)安全
    #define SECURITY_LEVEL      0   //安全等級
#endif
#elif ( STACK_PROFILE_ID == GENERIC_STAR )//如果為一般星型網(wǎng)絡(luò)
    #define MAX_NODE_DEPTH      5//結(jié)點(diǎn)深度5
    #define NWK_MODE            NWK_MODE_STAR//網(wǎng)絡(luò)模式,星型
    #define SECURITY_MODE       SECURITY_RESIDENTIAL//安全模式,住宅模式
#if   ( SECURE != 0 )
    #define USE_NWK_SECURITY    1   // true or false 使用網(wǎng)絡(luò)安全
    #define SECURITY_LEVEL      5//安全等級5

#else
#define USE_NWK_SECURITY    0   // true or false 不使用網(wǎng)絡(luò)安全
    #define SECURITY_LEVEL      0//安全等級0
#endif
#elif ( STACK_PROFILE_ID == NETWORK_SPECIFIC )//如果為特定網(wǎng)絡(luò)
// define your own stack profile settings
    #define MAX_NODE_DEPTH          5//結(jié)點(diǎn)深度5
    #define NWK_MODE            NWK_MODE_MESH//網(wǎng)絡(luò)模式,MESH
    #define SECURITY_MODE       SECURITY_RESIDENTIAL    //安全模式,一般住宅模式
#if   ( SECURE != 0 )
    #define USE_NWK_SECURITY    1   // true or false 使用網(wǎng)絡(luò)安全
    #define SECURITY_LEVEL      5//安全等級5
#else
    #define USE_NWK_SECURITY    0   // true or false 不使用網(wǎng)絡(luò)安全
    #define SECURITY_LEVEL      0//安全等級0
#endif
#endif






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1