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.

ZDP_MgmtLeaveReq - started from main

Hi Friends,

I have removed the end device from coordinator using ZDP_MgmtleaveReq.

After end device removed from coordinator,

Do the end device execution starts from main?

Regards,

Keerthi G.

  • Yes, device would starts from main. You can check ZDO_LeaveInd() in ZDApp.c and see device would do reset after receiving leave command.
  • Hi Chen,
    Thanks for the quick reply.
    1) I have define some of the functions in main (user defined).
    It is executed only once at start up.
    No need to executed after reset happen because of leave_req.
    How Can I exclude some of function after reset(leave_req reset)?

    2) The end device again and again joined to same coordinator after issuing leave_req ?
    The process like, join-leave-join-leave..... Is it happen?

    But I need to join end device to other coordinator. How Can I do this?


    Regards,
    Keerthi G.
  • Hi Chen,
    Instead of resetting the device, Is there any way to search other coordinator present within the region?


    Regards,
    Keerthi G.
  • You can refer to the solution provided by Cetri at http://e2e.ti.com/support/wireless_connectivity/f/158/p/381276/1343379#1343379
  • Hi Chen,
    Thanks for the guidance.
    I will test and come back.


    Regards,
    Keerthi G.
  • Hi Chen,

    I have followed the cetri solution.

    Now the end device don't get reset.

    But it joins again and again same coordinator.

    I assumed it because The state is rejoin and extended PANID read from nwk base.(So it is joined to same coordinator)

    I have modified little in code. i don't know whether it is correct or not. but it works.

    Please tell me, Is the modification correct or not?  Do I follow this one? 

    void ZDApp_LeaveReset( uint8 ra )

    {

     ZDApp_LeaveCtrlSet( ra );

    +  APSME_HoldDataRequests( LEAVE_RESET_DELAY);

    +  if ( ZSTACK_ROUTER_BUILD )

    +  {

    +    osal_stop_timerEx( NWK_TaskID, NWK_LINK_STATUS_EVT );

    +    osal_clear_event( NWK_TaskID, NWK_LINK_STATUS_EVT );

    +  }

    +

    +  if ( ra == TRUE )

    +  {

    +    devState = DEV_NWK_DISC;

    +    devStartMode = MODE_REJOIN; ( I have changed this to MODE_JOIN)

    +    _tmpRejoinState = true;

    +

    +    if (ZG_DEVICE_ENDDEVICE_TYPE)

    +    {

    +      zgPollRate = POLL_RATE;

    +      ZDApp_SavedPollRate = zgPollRate;

    +      NLME_SetPollRate(0);

    +    }

    +

    +    // For rejoin, specify the extended PANID to look for

    +    osal_cpyExtAddr( ZDO_UseExtendedPANID, _NIB.extendedPANID ); // Comment out this. I don't include this in code.

    +

    +    _NIB.nwkState = NWK_DISC;

    +

    +    zdoDiscCounter = 3;

    +    NLME_NwkDiscTerm();

    +

    +    ZDApp_NetworkInit((uint16)(NWK_START_DELAY + ((uint16) (osal_rand() & EXTENDED_JOINING_RANDOM_MASK ))));

    +  }

    +  else

    +  {

       ZDApp_ResetTimerStart( LEAVE_RESET_DELAY );

    +  }

    }

    One more doubt. 

    what is the difference between JOIN and REJOIN in zstack?

    Regards,

    Keerthi G.

  • Yes, your modification is correct.
  • Hi Chen,
    1) Even device not connected to coordinator, I will be storing the temperature values into memory at periodic interval.
    Is this process interrupted by joining process or not?

    2) Sorry for asking gain. Please tell me difference between MODE_JOIN and MODE_REJOIN?


    Regards,
    Keerthi G
  • 1. Yes, it shouldn't be interrupted by joining process.
    2. MODE_JOIN is for joining new zb network. MODE_REJOIN is for rejoining a pre-associated zb network.