怎么配置网络结构
用z-stack2.5.1a 怎么配置网络结构,比如星形网络、树状网络、mesh网络
在网络看到一些信息,说在nwk_globals.h中定义了网络结构,对于STACK_PROFILE_ID == HOME_CONTROLS,可以将其定义为星形网络吗?
在安装文件下找到nwk_globals.h文件
// Controls the operational mode of network【网络模式控制】
#define NWK_MODE_STAR 0
#define NWK_MODE_TREE 1
#define NWK_MODE_MESH 2
直接修改NWK_MODE的值?
拓扑结构和STACK_PROFILE_ID有关
#if ( STACK_PROFILE_ID == ZIGBEEPRO_PROFILE )
#define MAX_NODE_DEPTH 20
#define NWK_MODE NWK_MODE_MESH
#define SECURITY_MODE SECURITY_COMMERCIAL
#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 == HOME_CONTROLS )
#define MAX_NODE_DEPTH 5
#define NWK_MODE NWK_MODE_MESH
#define SECURITY_MODE SECURITY_COMMERCIAL
#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
#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
#else
#define USE_NWK_SECURITY 0 // true or false
#define SECURITY_LEVEL 0
#endif
#elif ( STACK_PROFILE_ID == NETWORK_SPECIFIC )
// define your own stack profile settings
#define MAX_NODE_DEPTH 5
#define NWK_MODE NWK_MODE_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
#endif