Other Parts Discussed in Thread: Z-STACK
Thread 中讨论的其他器件:Z-stack
在"zDO_object.c"中、函数"ZDO_ProcessMgmtLeaveReq"。
if ( ZG_BUILD_ENDDEVICE_TYPE )
{
//If rejoin is TRUE, the device will stop polling when processing rejoin.
if(req.rejoin == FALSE)
{
// Stop polling and get ready to reset
nwk_SetCurrentPollRateType(POLL_RATE_DISABLED,TRUE);
}
}
注释显示"如果重新加入为真、则器件将在处理重新加入时停止轮询。" 但在此代码中、当重加入标志为"false"时、轮询将停止。 另一个问题是、终端设备收到的 mgmt-leave 命令的 target-extAddr DNO 与当前终端设备不匹配、终端设备仍将停止轮询。
因此、我认为该代码应该是这样的
//If rejoin is TRUE, the device will stop polling when processing rejoin.
//Is there any controversial processing about End-Device's Mgmt-Leave command, luoyiming 2020-07-07
if( (req.rejoin == TRUE) && (req.extAddr == NULL) )
{
// Stop polling and get ready to reset
nwk_SetCurrentPollRateType(POLL_RATE_DISABLED,TRUE);
}