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.
Hi all。
there are two devices ZED and ZC。
some time ZC will send Send a Management Leave request to ZED.
The ZED need to leave the network and going to rejoin again , and it was set hold auto start。
1. i regsiter Mgmt_Leave_req in APP init function.
// Register with the ZDO to receive Mgmt_Leave_req ZDO_RegisterForZDOMsg(zclConnectSwitch_TaskID, Mgmt_Leave_req);
2. I add the case in zclConnectSwitch_ProcessZDOMsgs()
static void zclTest_ProcessZDOMsgs( zdoIncomingMsg_t *pMsg ) { ZStatus_t status = ZSuccess; switch (pMsg->clusterID) { case Mgmt_Leave_req: RemoteLeaveReq = TRUE; zclTest_BasicResetCB(); ZDP_MgmtLeaveRsp( pMsg->TransSeq, &pMsg->srcAddr,status, pMsg->SecurityUse ); break; default: break; } }
3. i do the reset in zclTest_BasicResetCB();
void zclTest_BasicResetCB() { zgWriteStartupOptions( ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE | ZCD_STARTOPT_DEFAULT_CONFIG_STATE ); NLME_LeaveReq_t leaveReq; osal_memset( &leaveReq, 0, sizeof( NLME_LeaveReq_t ) ); if(RemoteLeaveReq == TRUE) { leaveReq.rejoin = TRUE; } else { //local key long press do not rejoin again leaveReq.rejoin = FALSE; } if(RemoteLeaveReq == TRUE) { RemoteLeaveReq = FALSE; ZDOInitDevice( 0 ); } else { MT_SysCommandProcessing( aProcessCmd ); } }
but when it receive the remote leave request, it could not restart to search the new network
and it just always rejoin the previous network although it was stop permit join !
thanks yikai
so there is no need to add NLME_LeaveReq( NLME_LeaveReq_t* req )?
BR!
Hi yikai
i have do a test of the Management Leave request Cmd。
when ZED receive the Management Leave request Cmd it will do the below step
{
// Set the NV startup option to force a "new" join.
zgWriteStartupOptions( ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE );
// The device has been in the UNAUTH state, so reset
// Note: there will be no return from this call
SystemResetSoft();
}
but the ZED could not start to research (sending beacon request ) again.
ZC management leave request cmd is just like below :
the ZED enable HOLD AUTO START , is that matter with the device could not researching network ?
or is that relate with the Rejoin parameter of Management Leave Request cmd ?(But i have set it TRUE)
BR!
If you disable HOLD_AUTO_START, the device would do rejoin or not according to Rejoin parameter of Management Leave Request. ZDApp_LeaveReset is used for setuping a device reset due to a leave indication/confirm.