加了NV_RESTORE和NV_INIT,设备可以保存已经连接好的网络信息,但是想让设备连接到另外一个协调器,用ztool工具修改了相应的NV中的PAN ID值,还是不能连接到新的协调器上。试过了用flash programmer清除掉flash中的所有内容是可以达到这个目的的,但是想在协议栈代码中通过软件方式实现,是否有函数可以调用或是需要做哪些设置呢?
Susan Yang:
If application wants to delete the stored NV information It just needs to set the ZCD_NV_STARTUP_OPTION as explained below and do a reset.
"If the application would like to force a "new" join, the application should set the ZCD_STARTOPT_DEFAULT_NETWORK_STATE bit in the ZCD_NV_STARTUP_OPTION NV item before calling this function. "New" join means to not restore the network state of the device. Use zgWriteStartupOptions() to set these options
[zgWriteStartupOptions(ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE);]
zGlobals.c中有这个函数
uint8 zgWriteStartupOptions( uint8 action, uint8 bitOptions ) //修改ZCD_NV_STARTUP_OPTION的值