请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:LAUNCHXL-CC1352P 工具与软件:
环境中有多个协调人、他们都已关闭许可工作。 如果路由器未能检测到加入网络的可能性、它将崩溃。
没错。 此问题是由函数'bdb_filterNwkDisc'引起的。 它可以像这样进行固定。
void bdb_filterNwkDisc(void)
{
networkDesc_t* pNwkDesc;
uint8_t i = 0;
uint8_t ResultCount = 0, ResultTotal = 0;
pBDBListNwk = nwk_getNwkDescList();
nwk_desc_list_release();
pNwkDesc = pBDBListNwk;
while (pNwkDesc)
{
ResultCount++;
pNwkDesc = pNwkDesc->nextDesc;
}
ResultTotal = ResultCount;
if(pBDBListNwk)
{
pNwkDesc = pBDBListNwk;
if(pNwkDesc)
{
void *nextDesc = pNwkDesc->nextDesc;
// "nextDesc" replace "pNwkDesc->nextDesc" because "pNwkDesc->nextDesc" is not corret after freed, fixed by LuoYiming 2025-03-10
for ( i = 0; i < ResultTotal; i++, pNwkDesc = nextDesc )
{
nextDesc = pNwkDesc->nextDesc; // get the "nextDesc" before "pNwkDesc" is freed, fixed by LuoYiming 2025-03-10
if ( nwk_ExtPANIDValid( ZDO_UseExtendedPANID ) == true )
{
// If the extended Pan ID is commissioned to a non zero value
// Only join the Pan that has match EPID
if ( osal_ExtAddrEqual( ZDO_UseExtendedPANID, pNwkDesc->extendedPANID) == false )
{
//Remove from the list
bdb_nwkDescFree(pNwkDesc);
ResultCount--;
continue;
}
}
else if ( zgConfigPANID != 0xFFFF )
{
// PAN Id is preconfigured. check if it matches
if ( pNwkDesc->panId != zgConfigPANID )
{
//Remove from the list
bdb_nwkDescFree(pNwkDesc);
ResultCount--;
continue;
}
}
if ( pNwkDesc->chosenRouter != _NIB.nwkCoordAddress || _NIB.nwkCoordAddress == INVALID_NODE_ADDR )
{
// check that network is allowing joining
if ( ZSTACK_ROUTER_BUILD )
{
if ( !pNwkDesc->routerCapacity )
{
//Remove from the list
bdb_nwkDescFree(pNwkDesc);
ResultCount--;
continue;
}
}
else if ( ZSTACK_END_DEVICE_BUILD )
{
if ( !pNwkDesc->deviceCapacity )
{
//Remove from the list
bdb_nwkDescFree(pNwkDesc);
ResultCount--;
continue;
}
}
}
// check version of zigbee protocol
if ( pNwkDesc->version != _NIB.nwkProtocolVersion )
continue;
// check version of stack profile, only matching profiles are supported
if ( pNwkDesc->stackProfile != zgStackProfile )
{
//Remove from the list
bdb_nwkDescFree(pNwkDesc);
ResultCount--;
continue;
}
}
}
}
//Notify the application about the remaining valid networks to join
if(pfnFilterNwkDesc)
{
pfnFilterNwkDesc(pBDBListNwk, ResultCount);
}
}