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.

CC2538: network formation

Part Number: CC2538

what is the meaning of NLME_NetworkFormationRequest() ?

Does it use for network formation?

Best Regards

  Xian Wang

  • Yes. The call chain looks roughly like this:
    1. bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION)
    2. bdb_nwkJoiningFormation()
    3. ZDOInitDeviceEx()
    4. ZDApp_NetworkInit()
    5. ZDO_StartDevice()
    6. NLME_NetworkFormationRequest()

    All of the code above is in the BDB and ZDO layer.
  • Thank you for the reply.
    One more question is that if the network formation request done, does the commission status change into success?
    If not, when does the SUCCESS notification happened?

    Best Regards
    Xian Wang
  • Yes, it is for forming Zigbee network.

  • The result of NLME_NetworkFormationRequest() is returned in a ZDO callback function, ZDO_NetworkFormationConfirmCB(). In ZDO_NetworkFormationConfirmCB(), if we successfully formed the network, we call bdb_nwkFormationAttempt(TRUE), which calls bdb_reportCommissioningState(BDB_COMMISSIONING_STATE_FORMATION,TRUE), which then reports BDB_COMMISSIONING_FORMATION as BDB_COMMISSIONING_SUCCESS to your application.
  • Thank you for the reply.

    One more question is that in ZDO_NetworkFormationConfirmCB(), I think it should follow the if(ZG_DEVICE_COORDINATOR_TYPE) if the network is centralized and then set coordinator start. On the other hand, if it follows if(ZG_DEVICE_RTR_TYPE) then it means the network is distributed. Is that right?

    Best Regards

      Xian Wang

  • That is correct, Z3.0 routers will attempt to form a Distributed security network if bdb commissioning with mode BDB_COMMISSIONING_MODE_NWK_FORMATION is started.
  • Thank you for the reply.

    I check the following code afterwards, and the code comes to the event ZDO_NETWORK_START.

    The following code comes,
    if(events& ZDO_NETWORK_START)
    ZDApp_NetworkStartEvt() (the nwkStatus now should be ZSuccess)
    and then in ZDApp_NetworkStartEvt(), there are two useful functions, ZDApp_NwkWriteNvRequest() and ZDApp_ChangeState(DEV_ZB_COORD). After that, it comes to if(bdbCommissioningProcedureState.bdbCommissioningState == BDB_COMMISSIONING_STATE_FORMATION) and then bdb_nwkFormationAttempt(TRUE);

    My question is in bdb_nwkFormationAttempt(TRUE), it comes to the function bdb_reportCommissioningState(BDB_COMMISSIONING_STATE_FORMATION,TRUE), and then the code comes to
    case BDB_COMMISSIONING_STATE_FORMATION,
    and then define bdbAttributes.bdbCommissioningStatus = BDB_COMMISSIONING_SUCCESS, this means the network formation done, right?

    And then after that the last three lines of this cases are
    bdbCommissioningProcedureState.bdbCommissioningState = BDB_COMMISSIONING_STATE_START_RESUME;
    osal_start_timerEx(bdb_TaskID,BDB_CHANGE_COMMISSIONING_STATE,50);
    bdbAttributes.bdbCommissioningMode &= ~BDB_COMMISSIONING_MODE_NWK_FORMATION;
    The next question is that in the next BDB_CHANGE_COMMISSIONING event, the code should be in network steering part, right?
    Since the last line set the bdbCommissioningMode and 01010 (no Touchlink here), and the highest priority next is network steering.

    Best Regards
    Xian Wang