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.

zstack3.0 for cc2538的函数 ZDO_ProcessMgmtPermitJoinReq ,默认有时间限制,如何让它一直允许入网?

函数如下:

void ZDO_ProcessMgmtPermitJoinReq( zdoIncomingMsg_t *inMsg )
{
  uint8 stat;
  uint8 duration;
#if (ZG_BUILD_COORDINATOR_TYPE)
  if(ZG_DEVICE_COORDINATOR_TYPE)
  {
    //If zgAllowRemoteTCPolicyChange is set to FALSE, the request from other
    //devices cannot affect the  Trust Center policies
    if((zgAllowRemoteTCPolicyChange == 0) && (inMsg->srcAddr.addr.shortAddr!= 0x0000))
    {
      return;
    }
  }
#endif
 
  duration = inMsg->asdu[ZDP_MGMT_PERMIT_JOIN_REQ_DURATION];
  // Per R21 Spec this field is not longer relevant 2.4.3.3.7.2 (Mgmt_Permit_Joining_req Effect on Receipt)
  //tcsig    = inMsg->asdu[ZDP_MGMT_PERMIT_JOIN_REQ_TC_SIG];

  // Per R21 Spec this duration cannot last forever 2.4.3.3.7.2 (Mgmt_Permit_Joining_req Effect on Receipt)
  if(duration == 0xFF)
  {
    duration = 0xFE;
  }
 
  // Set the network layer permit join duration
  stat = (byte) NLME_PermitJoiningRequest( duration );

  //Handle the permit joining if running a distributed network
  if(APSME_IsDistributedSecurity())
  {
    ZDSecMgrPermitJoining( duration );
  }
 
  // Handle the Trust Center Significance
  if ( ZG_SECURE_ENABLED && ZG_BUILD_COORDINATOR_TYPE && ZG_DEVICE_COORDINATOR_TYPE )
  {
    ZDSecMgrPermitJoining( duration );
  }

  // Send a response if unicast
  if ( !inMsg->wasBroadcast )
  {
    ZDP_MgmtPermitJoinRsp( inMsg->TransSeq, &(inMsg->srcAddr), stat, false );
  }
}