你需要加入 reset 功能
你看一下 ZDApp.c 的 ZDOInitDevice()
去執行這段
#if defined ( NV_RESTORE )
// Hold down the SW_BYPASS_NV key (defined in OnBoard.h)
// while booting to skip past NV Restore.
if ( zdappHoldKeys == SW_BYPASS_NV )
[
zdappHoldKeys = 0; // Only once
networkStateNV = ZDO_INITDEV_NEW_NETWORK_STATE;
]
else
[
// Determine if NV should be restored
networkStateNV = ZDApp_ReadNetworkRestoreState();
]
if ( networkStateNV == ZDO_INITDEV_RESTORED_NETWORK_STATE )
[
networkStateNV = ZDApp_RestoreNetworkState();
]
else
[
// Wipe out the network state in NV
NLME_InitNV();
NLME_SetDefaultNV();
// clear NWK key values
ZDSecMgrClearNVKeyValues();
]
#endif
你需要加入 reset 功能
你看一下 ZDApp.c 的 ZDOInitDevice()
去執行這段
#if defined ( NV_RESTORE )
// Hold down the SW_BYPASS_NV key (defined in OnBoard.h)
// while booting to skip past NV Restore.
if ( zdappHoldKeys == SW_BYPASS_NV )
[
zdappHoldKeys = 0; // Only once
networkStateNV = ZDO_INITDEV_NEW_NETWORK_STATE;
]
else
[
// Determine if NV should be restored
networkStateNV = ZDApp_ReadNetworkRestoreState();
]
if ( networkStateNV == ZDO_INITDEV_RESTORED_NETWORK_STATE )
[
networkStateNV = ZDApp_RestoreNetworkState();
]
else
[
// Wipe out the network state in NV
NLME_InitNV();
NLME_SetDefaultNV();
// clear NWK key values
ZDSecMgrClearNVKeyValues();
]
#endif
举报