Other Parts Discussed in Thread: Z-STACK
in "zdo_object.c", function "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);
}
}
The annotation said that "If rejoin is TRUE, the device will stop polling when processing rejoin.". But in this code, the polling is stoped when rejoin flag is "FALSE". The other issue is that end-device receives mgmt-leave-command whose target-extAddr dnon't match with current end-device's, the end device will still stop polling.
So I think this code should be like this
//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);
}