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.

NV_INIT NV_RESTORE协调器无法恢复网络

定义了 NV_INIT NV_RESTORE 路由器可以恢复网络。没问题。

协调器怎么样都无法恢复网络,重启会自动新建网络。

 ZDOInitDevice(0);

里面

ZDApp_RestoreNetworkState();   

uint8 ZDApp_RestoreNetworkState( void )
{
uint8 nvStat;

// Initialize NWK NV items
nvStat = NLME_InitNV();

if ( nvStat != NV_OPER_FAILED )
{
if ( NLME_RestoreFromNV() ) //  返回一直都是0
{
// Are we a coordinator
ZDAppNwkAddr.addr.shortAddr = NLME_GetShortAddr();
if ( ZDAppNwkAddr.addr.shortAddr == 0 )
ZDO_Config_Node_Descriptor.LogicalType = NODETYPE_COORDINATOR;
devStartMode = MODE_RESUME;
osal_cpyExtAddr( ZDO_UseExtendedPANID, _NIB.extendedPANID );
}
else
nvStat = NV_ITEM_UNINIT;

if ( ZG_SECURE_ENABLED )
{
nwkFrameCounterChanges = 0;

if ( ZG_BUILD_COORDINATOR_TYPE && ZG_DEVICE_COORDINATOR_TYPE )
{
ZDApp_RestoreNwkKey();
}
}

// The default for RxOnWhenIdle is true for Routers and false for end devices
// [setup in the NLME_RestoreFromNV()]. Change it here if you want something
// other than default.
}

if ( nvStat == ZSUCCESS )
return ( ZDO_INITDEV_RESTORED_NETWORK_STATE );
else
return ( ZDO_INITDEV_NEW_NETWORK_STATE );
}

求解,谢谢