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.

CC2650EMK: ZDO_JoinConfirmCB and NLME_RejoinRequest return value

Part Number: CC2650EMK
Other Parts Discussed in Thread: CC2538, CC2650, Z-STACK


I've  Zigbee end devices ( CC2650) developed  based on Z Stack 1.2.2HA  which communicate with coordinator CC2538 .

I debug rejoinRequest and the call back function(ZDO_JoinConfirmCB) that results.
I read z-stack API document, but return value was not written it.
I want to know what kind of error does NLME_RejoinReuqest function and when does ZSuccess return.

Please let us know if you know.

Best Regards,
Yuya Murata

  • Hi Yuya,

    Network status return values are provided in ZComDef.h

    	// NWK status values
    #define ZNwkInvalidParam            0xc1
    #define ZNwkInvalidRequest          0xc2
    #define ZNwkNotPermitted            0xc3
    #define ZNwkStartupFailure          0xc4
    #define ZNwkAlreadyPresent          0xc5
    #define ZNwkSyncFailure             0xc6
    #define ZNwkTableFull               0xc7
    #define ZNwkUnknownDevice           0xc8
    #define ZNwkUnsupportedAttribute    0xc9
    #define ZNwkNoNetworks              0xca
    #define ZNwkLeaveUnconfirmed        0xcb
    #define ZNwkNoAck                   0xcc  // not in spec
    #define ZNwkNoRoute                 0xcd

    ZMemError (0x10) is also possible if memory cannot be allocated for the request, along with any other Data request error return values

    #define ZMemError                   0x10
    #define ZBufferFull                 0x11
    #define ZUnsupportedMode            0x12
    #define ZMacMemError                0x13

    Otherwise ZSuccess is returned if the NLDE_DataReq (formatted for a rejoin request) is successfully sent, and the device would now be awaiting a rejoin response.  If this response never comes and thus ZDO_JoinConfirmCB is not entered, you can expect a NWK_REJOIN_TIMEOUT_EVT event instead.


  • Hi Ryan,
    Thank you for your reply.

    I understand that if NLDE_DataReq is successful and a Rejoin Request packet is issued from ZED, the rejoinStatus in the following code will be ZSuccess.
    (ZDApp.c, Line 1253)


       rejoinStatus = NLME_ReJoinRequest( ZDO_UseExtendedPANID, pChosenNwk->logicalChannel);

    I have a question about ZDO_JoinConfirmCB function.
    When does the status in the following code become ZSuccess? Also, when do other error codes occur?
    (ZDApp.c, Line 2678)

    void ZDO_JoinConfirmCB( uint16 PanId, ZStatus_t Status )

    If this response never comes and thus ZDO_JoinConfirmCB is not entered, you can expect a NWK_REJOIN_TIMEOUT_EVT event instead.
      Is the NWK_REJOIN_TIMEOUT_EVT event occurring in code that is not exposed to us?

    Thank you for your help.

    Best Reagards,
    Yuya Murata

  • ZDO_JoinConfirmCB is the result of NLME_JoinConfirm being returned from the NWK layer after a successful network rejoin (in this instance).  If NWK_REJOIN_TIMEOUT_EVT expires then you can expect ZDO_JoinConfirmCB to be called with status ZFailure.


  • Hi, Ryan
    Thank you for your reply.

    It is recognized that the TIMEOUT event occurs (REJOIN_POLL_RATE * 4 ms) ms after the Rejoin Request is issued.
    Is this correct?
    For example, it occurs 1760 ms later when REJOIN_POLL_RATE = 440. (f8wConfig.cfg)

    /* This is used as an alternate response poll rate only for rejoin request.
     * This rate is determined by the response time of the parent that the device
     * is trying to join.

    Can this event be detected by ZDApp's event_loop?

    Best Regards,

  • What event do you mean to detect?

  • Hi, YiKai
    Thank you for your reply.

    I want to check NWK_REJOIN_TIMEOUT_EVT happen.

    Best Regards,

  • NWK_REJOIN_TIMEOUT_EVT  is handled in Z-Stack library and related source code is not available for application developers. If you mean to know how long it would take before NWK_REJOIN_TIMEOUT_EVT, you can use API osal_get_timeoutEx to get timeout value.

  • NWK_REJOIN_TIMEOUT_EVT expires at REJOIN_POLL_RATE * 4 ms in the Z-Stack source code for rejoin request, or a pre-determined total scan duration for orphan join requests (less pertinent).  ZDApp.c receives notification of the Join Confirm Callback status (success or failure) through ZDO_JoinConfirmCB, which is the extent of granularity offered to developers.


  • Hi, Ryan
    Thank you for your reply.

    Is the timeout for NLME_NetworkDiscoveryRequest also the same as NLME_RejoinRequest?

    Best Regards,

  • NLME_NetworkDiscoveryRequest does not start the NWK_REJOIN_TIMEOUT_EVT timer.

  • Hi, Ryan,

    I was asking the wrong question.
    Is there no timeout in NLME_NetworkDiscoveryRequest?
    I am asking about whether NLME_NetworkDiscoveryRequest has a timeout.
    Also, how many seconds does NLME_NetworkDiscoveryRequest time out?

    Best Regards,
    Yuya Murata

  • There is no timeout in NLME_NetworkDiscoveryRequest, if MAC_SCAN_IN_PROGRESS/MAC_NO_RESOURCES is not returned then it initiates a ZMacScanReq -> MAC_MlmeScanReq and ends with ZMacSuccess.