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.

NLME_DirectJoinRequest() function don't give result

Other Parts Discussed in Thread: Z-STACK

Hello everyone,

I use ZStack-CC2530-2.4.0, and I'm trying to use the function

NLME_DirectJoinRequest()

but it doesn't  give any result.

In "SampleApp.c", I defined 3 switches like this:

unsigned char device_address[8] = {0xD9, 0xA6, 0x17, 0x01, 0x00, 0x4B, 0x12, 0x00};   //external ZED address
byte mac_cap = CAPINFO_DEVICETYPE_RFD;

void SampleApp_HandleKeys( uint8 shift, uint8 keys )
{
  (void)shift;

 if ( keys & HAL_KEY_SW_1 )
  {
//    ZDP_MgmtDirectJoinReq( &ZAddr, device_address, mac_cap, 0 );
    NLME_DirectJoinRequest( device_address, mac_cap );
  }

  if ( keys & HAL_KEY_SW_2 )
  {
      zAddrType_t ZAddr;
    ZAddr.addr.shortAddr = NLME_GetShortAddr();
    ZAddr.addrMode = Addr16Bit;
     ZDP_MgmtLeaveReq( &ZAddr, device_address,1,1, 0 );
  }


   if ( keys & HAL_KEY_SW_4 )
  {

    NLME_RemoveChild( device_address, TRUE ); // second parametr dealloc

  }

}

When I push SW1, it must join to my ZC or ZR, SW2 enables ZED to leave his current parent but nothing happens.

I'm trying SW4 NLME_RemoveChild but it also doesn't help removing child from his parent.

I turn on flags in  ZDConfig.h

ZDO_MGMT_JOINDIRECT_REQUEST
ZDO_MGMT_LEAVE_REQUEST
ZDO_MGMT_LEAVE_RESPONSE

My questions are: What have i done wrong, or what did i forget to do that made this function not work?

How can i test these function to see that they work correctly?

 

  • hi
    do you found out the problem?
    i have do a same test , and i found that the end device only send a orphan notification and then always send beacon request ,could not join the network
  • Hi all

    i am try to follow the swru124a Document note for Using the Direct Join Request Feature in Z-Stack ( NLME_DirectJoinRequest())。

    step1:i change the devStartMode define in the ZDApp.c file:

    #if ( ZG_BUILD_RTRONLY_TYPE ) || ( ZG_BUILD_ENDDEVICE_TYPE )
    #ifdef DIRECTJOIN
    devStartModes_t devStartMode = MODE_RESUME;
    #else
    devStartModes_t devStartMode = MODE_JOIN;
    #endif
    #else
    devStartModes_t devStartMode = MODE_HARD;
    #endif


    step2 : change the ZDAppDetermineDeviceType function

    if ( nwk_ExtPANIDValid( AIB_apsUseExtendedPANID ) == false )
    {
    #ifdef DIRECTJOIN
    devStartMode = MODE_RESUME;
    #else
    devStartMode = MODE_JOIN; // Assume joining
    #endif
    }


    step 3: add the NLME_DirectJoinRequest() in coordinator side

    void HandleKeys( uint8 keys )
    {
    if( keys & HAL_KEY_SW_0 )
    {
    unsigned char device_address[8] = {0x00, 0x12, 0x4B, 0x00, 0x07, 0x71, 0x79, 0x70};
    ZStatus_t state;
    HalLedBlink ( HAL_LED_1,10,50,200);
    state = NLME_DirectJoinRequest( device_address, CAPINFO_DEVICETYPE_RFD );
    }
    }


    step4:power on the coordinator, and then press the key , i saw the LED blink ,and return state value is ZSUCCESS

    but i have not seen anything in the ubiqua windows~~~~~

    Q1 : is that mean coordinator would not send out anything while execute the NLME_DirectJoinRequest()

    Step 5:

    when the end device power on, it send out a orphan notification then always send beacon request and could not join the network。

    Q2 so what is wrong of my test ?

    WHY End device could not join the network in this mode?

    BR!

  • I try to help you on your another similar post at e2e.ti.com/.../1982309