zstack中开启安全选项的时候默认的securitylevel为5,在nwk_globals.h中也找到了相应代码,但通过改变这个宏定义的值似乎并不能改变securitylevel,因为我把security改为7后,在packetsniffer中没有看到MIC和辅助头,是不是有什么疏漏的地方?正确的方法应该是什么?望指点
以下为在Z-Stack Home 1.2.2a.44539中的nwk_globals.h:
#if ( STACK_PROFILE_ID == ZIGBEEPRO_PROFILE )#define MAX_NODE_DEPTH20#define NWK_MODENWK_MODE_MESH#define SECURITY_MODESECURITY_COMMERCIAL#if( SECURE != 0 )#define USE_NWK_SECURITY1// true or false#define SECURITY_LEVEL 5#else#define USE_NWK_SECURITY0// true or false#define SECURITY_LEVEL0#endif #elif ( STACK_PROFILE_ID == HOME_CONTROLS )#define MAX_NODE_DEPTH5#define NWK_MODENWK_MODE_MESH#define SECURITY_MODESECURITY_COMMERCIAL#if( SECURE != 0 )#define USE_NWK_SECURITY1// true or false#define SECURITY_LEVEL5#else#define USE_NWK_SECURITY0// true or false#define SECURITY_LEVEL0#endif #elif ( STACK_PROFILE_ID == GENERIC_STAR )#define MAX_NODE_DEPTH5#define NWK_MODENWK_MODE_STAR#define SECURITY_MODESECURITY_RESIDENTIAL#if( SECURE != 0 )#define USE_NWK_SECURITY1// true or false#define SECURITY_LEVEL5#else#define USE_NWK_SECURITY0// true or false#define SECURITY_LEVEL0 #endif #elif ( STACK_PROFILE_ID == NETWORK_SPECIFIC ) // define your own stack profile settings#define MAX_NODE_DEPTH5#define NWK_MODENWK_MODE_MESH#define SECURITY_MODESECURITY_RESIDENTIAL#if( SECURE != 0 )#define USE_NWK_SECURITY1// true or false#define SECURITY_LEVEL5#else#define USE_NWK_SECURITY0// true or false#define SECURITY_LEVEL0#endif #endif
VV:
请问你想改变这个的目的为了什么?
packet sniffer没办法解析加密的数据包,建议你用Ubiqua来解析。