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.

ZigBee coordinator and end device configuration for CC2530 DB

Other Parts Discussed in Thread: CC2530, Z-STACK

Hi,

   I have  two CC2530 DB, in which one as a coordinator and another one as a end device. How to set specific node joining time period at coordinator for allowing to join a new device???  

   Actually my requirement is once I power up the coordinator initially, it will wait for 10 sec to join the any device(router/end device). After that it won't allow to join a new device till next power cycle. For this type of configuration is there any parameter I have to set??? so, please suggest some solutions to this problem.

  • You can use ZDP_MgmtPermitJoinReq to enable permit join for 10 seconds on coordinator after it boots up.

  • Hi Yikai Chen,
    Thanks for replay. where I can find this parameter in Z-Stack Home 1.2.2.42930 file and in that Home Automation application??? I searched for that parameter and I didn't find any timing parameter to set.
  • ZDP_MgmtPermitJoinReq is implemented in ZDProfile.c and you can refer to section 3.1.6.13 ZDP_MgmtPermitJoinReq in Z-Stack API.pdf for parameter details. The alternative is to use NLME_PermitJoiningRequest which is defined in NLMEDE.h and you only need to pass permit join duration as parameter.

    /*
    * ZDP_MgmtPermitJoinReq - Send a Management Permit Join Request
    *
    * @MT SPI_CMD_ZDO_MGMT_PERMIT_JOIN_REQ
    * (UInt16 DstAddr,
    * byte duration,
    * byte TcSignificance)
    *
    */
    extern afStatus_t ZDP_MgmtPermitJoinReq( zAddrType_t *dstAddr,
    byte duration,
    byte TcSignificance,
    byte SecurityEnable );


    /*
    * This function defines how the next higher layer of a coordinator device
    * to permit devices to join its network for a fixed period.
    *
    * @MT SPI_CMD_NLME_PERMIT_JOINING_REQ
    *
    */
    extern ZStatus_t NLME_PermitJoiningRequest( byte PermitDuration );
  • Hi Yikai Chen,

    Thanks for replay. I tried with below piece of code(First one) which is in ZDProfile.c file. I am changing the duration parameter as 10 sec but it is not working (same as byte duration = some value). also I tried with second alternative it is showing error, in second alternative in place of "byte PermitDuration" i am placing desired value. so, please provide information about this errors.

    First one:-

    afStatus_t ZDP_MgmtPermitJoinReq( zAddrType_t *dstAddr, byte duration,
    byte TcSignificance, byte SecurityEnable )
    {
    (void)SecurityEnable; // Intentionally unreferenced parameter

    // Build buffer
    ZDP_TmpBuf[ZDP_MGMT_PERMIT_JOIN_REQ_DURATION] = 10;
    ZDP_TmpBuf[ZDP_MGMT_PERMIT_JOIN_REQ_TC_SIG] = TcSignificance;

    Second alternative:-

    extern ZStatus_t NLME_PermitJoiningRequest( 255 );
  • No, I don't mean you to change anything in ZDP_MgmtPermitJoinReq. You should call ZDP_MgmtPermitJoinReq or NLME_PermitJoiningRequest in your application code.
  • Thanks but still i have confusion

    Here I am using Home Automation sample application i.e. for coordinator sample thermostat code and for end device sample temperature sensor code. In that sample code where i have to define specific node joining time(10 secs) with those functions.
  • Add it to coordinator and place it in zclSampleThermostat_event_loop "case ZDO_STATE_CHANGE:".

           case ZDO_STATE_CHANGE:

             zclSampleThermostat_NwkState = (devStates_t)(MSGpkt->hdr.status);

             // now on the network

             if ( ( zclSampleThermostat_NwkState == DEV_ZB_COORD ) ||

                  ( zclSampleThermostat_NwkState == DEV_ROUTER )   ||

                  ( zclSampleThermostat_NwkState == DEV_END_DEVICE ) )

             {

    #ifndef HOLD_AUTO_START

               // display main mode

               giThermostatScreenMode = THERMOSTAT_MAINMODE;

               zclSampleThermostat_LcdDisplayUpdate();

    #endif

    #ifdef ZCL_EZMODE

               zcl_EZModeAction( EZMODE_ACTION_NETWORK_STARTED, NULL );

    #endif  // ZCL_EZMODE

               NLME_PermitJoiningRequest(10);

             }

             break;

  • Thanks a lot. it's working fine.
  • You are welcome and it's good to know it works.