This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2530: ZStack 2.51 a 版本 网络密钥问题,通过修改DEFAULT_TC_LINK_KEY的参数来区分不同的个域网,节点也都有修改,实际操作两个个域网还是能自由组网,没法隔离开两个网络,是否有其他办法实现

Part Number: CC2530
Other Parts Discussed in Thread: Z-STACK

nwk_globals.h文件中原始内容如下:

// ZigBee Alliance Pre-configured TC Link Key - 'ZigBeeAlliance09'
#define DEFAULT_TC_LINK_KEY { 0x5a, 0x69, 0x67, 0x42, 0x65, 0x65, 0x41, 0x6c,\
0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x30, 0x39 }

nwk_globals.h文件中修改如下:

// ZigBee Alliance Pre-configured TC Link Key - 'ZigBeeAlliance09'
#define DEFAULT_TC_LINK_KEY { 0x20, 0x69, 0x67, 0x42, 0x65, 0x65, 0x41, 0x6c,\
0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x30, 0x20 }

后续实验操作中,代码组网流程是这样的:

节点组网发起请求第一步

zgWriteStartupOptions(ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE);//删除当前的组网信息

resetflag[0] = 1 ;//终端复位标志置1

osal_nv_write(0x0402, 0, 12, resetflag);//模式写入到flash


SystemReset();//重启MCU

第二步节点设备复位之后会根据标志位执行ZDOInitDevice(0);

再复位前,协调器开启了入网窗口60s,设备就完成了该网络的入网,

问题:我给两个协调器烧录的程序是一个版本,除了nwk_globals.h文件中的key是不同的,A协调器是0x20...0x20,B协调器是0x10....0x10;C路由节点的keyf分两次烧录实验,分别为A协调器的key和B协调器的key。

    实验结果:

    C路由节点因为之前就加入过A协调器,无论key改成什么都只能加入到A协调器,始终没法加入到B协调器,麻烦TI大佬解惑