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.

Need detail of IAS_ZONE join procedure

Other Parts Discussed in Thread: Z-STACK

there is a CIE which is success forming a network。

when a IAS_ZONE  join the network, what is the detail procedure?

although i know the ZONE need to enroll first, but when use the enroll request function, you should put the Dst endpoint, how can i find this Dst endpoint? which the ZCL function could be use ? and how can i use it?

  • You should use ZDP_ActiveEPReq to request endpoint and use ZDP_SimpleDescReq to request simple descriptor from device.

  • sorry ,i am not familiar with ZDO layer program,let me have a try,and i will feedback this Msg later

  • hi Chen ,

             i think we should know the DstAddress before using ZDP_ActiveEPReq,

             ZDP_ActiveEPReq( &zDestAddr, shortAddr, SECURITY_FLAG);

             so the ZONE should be boardcast its address when it join the network, is that right?

             but as the new node(ZONE) how can you know the CIE addresss?

             

    so we call this is method 1: coding as below

              case ZDO_STATE_CHANGE:

    ZDP_DeviceAnnce( NLME_GetShortAddr(), NLME_GetExtAddr(),ZDO_Config_Node_Descriptor.CapabilityFlags, 0 ); 

    break

        Then  the CIE should set ZDO_RegisterForZDOMsg( task_id, Device_annce);  to receive the ZONE address boardcast ,and process it in the ZDO_CB_MSG, then send its Msg and Endpoint Msg for the  ZONE,

    BUT HOW?    

  • When IAS zone device joins Zigbee network, it can send ZDP_MatchDescReq. Then, CIE will response Match response and IAS zone can have the short address and endpoint of CIE.

  • Hi Chen ,

              It is a big question for me

    no matter Sending  ZDP_ActiveEPReq( dstAddr, NWKAddrOfInterest, SecurityEnable ) ,

    ZDP_MatchDescReq( zAddrType_t *dstAddr, uint16 nwkAddr,uint16 ProfileID,byte NumInClusters, uint16 *InClusterList,byte NumOutClusters, uint16 *OutClusterList,byte SecurityEnable ); 

    and ZDP_SimpleDescReq( zAddrType_t *dstAddr, uint16 nwkAddr,byte ep, byte SecurityEnable );

    there is always a question you can't avoid,

    The ZONE is just join the network, how could i know those color parameter

    anyway,if  the ZONE knows the CIE address,we could using those function as below directly 

    zclSS_IAS_Send_ZoneStatusEnrollRequestCmd( uint8 srcEP, afAddrType_t *dstAddr,
                                                         uint16 zoneType, uint16 manufacturerCode,
                                                         uint8 disableDefaultRsp, uint8 seqNum )

    zclSS_IAS_Send_ZoneStatusChangeNotificationCmd( uint8 srcEP, afAddrType_t *dstAddr,
                                                              uint16 zoneStatus, uint8 extendedStatus,
                                                              uint8 zoneID, uint16 delay,
                                                              uint8 disableDefaultRsp, uint8 seqNum )

     

    that is why i so distressed now

  • Hi Chen

                  there is a question about the Zone Settings Attribute Set

          i define a variable for save the CIE address in zclxxx_data.c   as below:

          uint8 zclIASZoneVibration_IAS_CIE_Address[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };

           

          And  my question is :

          1.  Method1 : by requesting the ZigBee cluster discovery service to locate a Zone Server cluster  ,  is that mean the zone use the discovery cmd to find the CIE device,and revalue  zclIASZoneVibration_IAS_CIE_Address[8]


         2. Method2 : require the intervention of a CT in order to configure this attribute during installation, 
    what is the intervention of a CT, and does it means join network success about during installation ?

         3. as the files note, it seems the CIE address was set by ZONE itself locally, but why there is also signed us a Read/Write in ACCESS

         4.  when everything OK, where and when will the Zone use this a variable ?

     

     

     

         

  • For an IAS zone device, you can send ZDP_MatchDescReq with broadcast when it joins Zigbee network. Since CIE also has to implement IAS zone cluster, it will do match response to IAS zone device. In this way, IAS zone device can have short address and endpoint of CIE when it receives match response.

  • hi Chen ,

               there is a question about ZONE  sending enroll request

               as the ZCL file note :

              

    1.the timer of sending enroll request

        it must do ..... network(during commissioning ), so is that means i should put the sending  enroll request CMD in the  ZDO_STATE_CHANGE: as like below:

                    case ZDO_STATE_CHANGE:

                      zclSS_IAS_Send_ZoneStatusEnrollRequestCmd( IASZoneVibration_ENDPOINT, \
                                  &???? ,\
                                SS_IAS_ZONE_TYPE_VIBRATION_MOVEMENT_SENSOR, \
                                  0 ,//???manfuctory code set 0 is OK?????
                                  1,
                                  1 );

                    break;

    2. the parameter of the enroll request cmd function

    /*******************************************************************************
     * @fn      zclSS_Send_IAS_ZoneStatusEnrollRequestCmd
     *
     * @brief   Call to send out a Enroll Request Command
     *
     * @param   srcEP - Sending application's endpoint
     * @param   dstAddr - where you want the message to go
     * @param   zoneType -    current value of Zone Type attribute
     * @param   manufacturerCode - manuf. code from node descriptor for the device
     * @param   disableDefaultRsp - toggle for enabling/disabling default response
     * @param   seqNum - command sequence number
     *
     * @return  ZStatus_t
     */
    ZStatus_t zclSS_IAS_Send_ZoneStatusEnrollRequestCmd( uint8 srcEP, afAddrType_t *dstAddr,
                                                         uint16 zoneType, uint16 manufacturerCode,
                                                         uint8 disableDefaultRsp, uint8 seqNum )

    ====》》when Zone just join the network in the first time, how could it knows the Dstaddress???

    ====》》if our production was during designing test which have not send to ZigBee , is that ok to set manufacturerCode  parameter to 0???

    ====》》if we set disableDefaultRsp to 1,is that means the CIE will not send the enroll response CMD back?

    if it is, that is so strange, because i think every ZONE send enroll request always wants to get a Zone ID, which state will not need to disable CIE response?????

  • After you do match request and get response, you will have short address to do enroll.

  • Hi Chen

                after CIE receive the Match req CMD ,it will process as below:

                 

    static void zclSampleThermostat_ProcessZDOMsgs( zdoIncomingMsg_t *pMsg )
    {
      zclEZMode_ActionData_t data;
      ZDO_MatchDescRsp_t *pMatchDescRsp;

      // Let EZ-Mode know of the Match Descriptor Response
      if ( pMsg->clusterID == Match_Desc_rsp )
      {
        pMatchDescRsp = ZDO_ParseEPListRsp( pMsg );
        data.pMatchDescRsp = pMatchDescRsp;
        zcl_EZModeAction( EZMODE_ACTION_MATCH_DESC_RSP, &data );
        osal_mem_free( pMatchDescRsp );
      }
    }

    but which function i should  use here to send the CIE shortaddre to  ZONE,

    and how does ZONES to receive it ?

  • No, the match response is received on IAZ zone side. So, you can pull out short address and endpoint of CIE from pMsg.

  • Hi Chen ,

          as you said, the Match request and Match response was all happen in IAS ZONE????

      so could i  put them in the EZ-MODE (key press) ???

    if(keypress )

    {

    #ifdef ZCL_EZMODE
          {
            zclEZMode_InvokeData_t ezModeData;
            static uint16 clusterIDs[] = { ZCL_CLUSTER_ID_SS_IAS_ZONE };   // only bind on the ACE/CIE/WD cluster

            // Invoke EZ-Mode
            ezModeData.endpoint = IASZoneVibration_ENDPOINT; // endpoint on which to invoke EZ-Mode
            if ( (zclIASZoneVibration_NwkState == DEV_ZB_COORD) ||
                     (zclIASZoneVibration_NwkState == DEV_ROUTER)   ||
                     (zclIASZoneVibration_NwkState == DEV_END_DEVICE) )
            {
              ezModeData.onNetwork = TRUE;      // node is already on the network
            }
            else
            {
              ezModeData.onNetwork = FALSE;     // node is not yet on the network
            }
            //Initiator – A node that initiates transactions (client) on the active cluste
            ezModeData.initiator = TRUE;        // IAS_ZONE is an initiator rs ?????
            ezModeData.numActiveOutClusters = 1;   // active output cluster
            ezModeData.pActiveOutClusterIDs = clusterIDs;
            ezModeData.numActiveInClusters = 0;  // no active input clusters
            ezModeData.pActiveInClusterIDs = NULL;
            zcl_InvokeEZMode( &ezModeData );// 调一次 开启EZ-MODE ,再调一次就为关闭EZ-Mode 


           HalUARTWrite(0,"Invoke EZ-Mode\n", sizeof("Invoke EZ-Mode\n"));
           

    #ifdef ZCL_ZONE
           //EZ-Mode 发起后,发送匹配 广播命令
                zAddrType_t dstAddr;
                dstAddr.addrMode = AddrBroadcast;
                dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR;
                ZDP_MatchDescReq( &dstAddr, NWK_BROADCAST_SHORTADDR,
                                 ZCL_HA_DEVICEID_IAS_ZONE,
                                 ZCLIASZoneVibration_BINDINGLIST_IN,
                                 bindinginClusters,
                                 0,
                                 NULL,
                                 FALSE
                                 );
                 HalUARTWrite(0,"Broadcast MatchDescReq\n", sizeof("Broadcast MatchDescReq\n"));
    #endif

     



          }

  • It should be OK.

  • and if everything OK ,is that means we will get the  dstaddress msg in ZONE。 as below?

    /*********************************************************************
     * @fn      zclIASZoneVibration_ProcessZDOMsgs
     *
     * @brief   Called when this node receives a ZDO/ZDP response.
     *
     * @param   none
     *
     * @return  status
     */
    static void zclIASZoneVibration_ProcessZDOMsgs( zdoIncomingMsg_t *pMsg )
    {

      // Let EZ-Mode know of the Match Descriptor Reponse (same as ActiveEP Response)
      if ( pMsg->clusterID == Match_Desc_rsp )
      {
        zclEZMode_ActionData_t data;
        ZDO_ActiveEndpointRsp_t *pRsp = ZDO_ParseEPListRsp( pMsg );
        data.pMatchDescRsp = pRsp;
        zcl_EZModeAction( EZMODE_ACTION_MATCH_DESC_RSP, &data );
        ????????next step  how to get the address from the pMSg????????

         osal_mem_free(pRsp);
      }

    }

    which address will the dst CIE address

    typedef struct
    {
      osal_event_hdr_t hdr;
      zAddrType_t      srcAddr;
      uint8            wasBroadcast;
      cId_t            clusterID;
      uint8            SecurityUse;
      uint8            TransSeq;
      uint8            asduLen;
      uint16           macDestAddr;
      uint8            *asdu;
      uint16           macSrcAddr;
    } zdoIncomingMsg_t;

  • Yes, you would get CIE address in srcAddr

  • hi Chen ,i am alway so confused about the procedure of IAS ZONE  connection to CIE,

    could please draw me a flow chart and make a note as below :

    i know it is an outrage, but please,please!

  • Hi chen ,

                  i coding CIE  EZ-Mode as below:

                  if (keypress)

                 {

                        #ifdef ZCL_EZMODE
        {
          zclEZMode_InvokeData_t ezModeData;
          static uint16 clusterIDs_Out[] = { ZCL_CLUSTER_ID_SS_IAS_ZONE ,ZCL_CLUSTER_ID_SS_IAS_WD};   // only bind out the Zone/WD cluster
          static uint16 clusterIDs_In[] = { ZCL_CLUSTER_ID_SS_IAS_ACE};   // only bind in the ACE cluster
         
          // Invoke EZ-Mode
          ezModeData.endpoint = IASCIE_ENDPOINT; // endpoint on which to invoke EZ-Mode
          if ( (zclIASCIE_NwkState == DEV_ZB_COORD) ||
                   (zclIASCIE_NwkState == DEV_ROUTER)   ||
                   (zclIASCIE_NwkState == DEV_END_DEVICE) )
          {
            ezModeData.onNetwork = TRUE;      // node is already on the network
          }
          else
          {
            ezModeData.onNetwork = FALSE;     // node is not yet on the network
          }
          ezModeData.initiator = TRUE;        // CIE is an  Target//initiator
          ezModeData.numActiveOutClusters = 2;   // active output cluster
          ezModeData.pActiveOutClusterIDs = clusterIDs_Out;
          ezModeData.numActiveInClusters = 1;  // no active input clusters
          ezModeData.pActiveInClusterIDs =  clusterIDs_In;
          zcl_InvokeEZMode( &ezModeData );

                 }

           and i code ZONE EM-MODE  as like that :

          if (keypress)

           {

                

    #ifdef ZCL_EZMODE
          {
            zclEZMode_InvokeData_t ezModeData;
            static uint16 clusterIDs[] = { ZCL_CLUSTER_ID_SS_IAS_ZONE };   // only bind on the ACE/CIE/WD cluster
           
            // Invoke EZ-Mode
            ezModeData.endpoint = IASZoneVibration_ENDPOINT; // endpoint on which to invoke EZ-Mode
            if ( (zclIASZoneVibration_NwkState == DEV_ZB_COORD) ||
                     (zclIASZoneVibration_NwkState == DEV_ROUTER)   ||
                     (zclIASZoneVibration_NwkState == DEV_END_DEVICE) )
            {
              ezModeData.onNetwork = TRUE;      // node is already on the network
            }
            else
            {
              ezModeData.onNetwork = FALSE;     // node is not yet on the network
            }
            //Initiator – A node that initiates transactions (client) on the active cluste
            ezModeData.initiator = TRUE;        // IAS_ZONE is an initiator rs
            ezModeData.numActiveOutClusters = 0;   //no  active output cluster
            ezModeData.pActiveOutClusterIDs = NULL;
            ezModeData.numActiveInClusters = 1;  //active input clusters
            ezModeData.pActiveInClusterIDs = clusterIDs;

            zcl_InvokeEZMode( &ezModeData );// 调一次 开启EZ-MODE ,再调一次就为关闭EZ-Mode 

       #ifdef ZCL_ZONE          
               //EZ-Mode 发起后,发送匹配 广播命令
                    zAddrType_t dstAddr;
                    dstAddr.addrMode = AddrBroadcast;
                    dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR;
                    ZDP_MatchDescReq( &dstAddr, NWK_BROADCAST_SHORTADDR,
                                     ZCL_HA_DEVICEID_IAS_ZONE,
                                     1,
                                     clusterIDs,
                                     0,
                                     NULL,
                                     FALSE
                                     );
                     HalUARTWrite(0,"Broadcast MatchDescReq\n", sizeof("Broadcast MatchDescReq\n"));
      #endif

           }

        and if match , i want to put out the CIE shortaddr  to PC by uart in ZONE side as below :

    static void zclIASZoneVibration_ProcessZDOMsgs( zdoIncomingMsg_t *pMsg )
    {

      // Let EZ-Mode know of the Match Descriptor Reponse (same as ActiveEP Response)
      if ( pMsg->clusterID == Match_Desc_rsp )
      {
        zclEZMode_ActionData_t data;
        ZDO_ActiveEndpointRsp_t *pRsp = ZDO_ParseEPListRsp( pMsg );
        data.pMatchDescRsp = pRsp;
        zcl_EZModeAction( EZMODE_ACTION_MATCH_DESC_RSP, &data );
       
        //接收到匹配信息
        //zAddrType_t  CIEsrcAddr;
        uint16 shortaddr;
        char str[7];
        shortaddr =  pMsg->srcAddr.addr.shortAddr;
     
        sprintf(str,"CIE addr:%d",shortaddr);
        HalUARTWrite(0,str,8);
       
        osal_mem_free(pRsp);
      }

     
    }

       but the result is  showing  nothing of the shortaddress。。。。。

          

           

             

  • 1. When you do testing on match request, I suggest you disable EZ-Mode define first. 

    2. Do you define ZDO_MATCH_REQUEST in your project?

  • 1.  when i use Centralized commissioning,EZ-mode should  be disabled???

        why ?? as the file said  EZ-Mode and Centralized commissioning are complementary and fully
    compatible.

     

    2. please take the pic as below ,i think  it is OK about define ZDO_MATCH_REQUEST

  • 1. There are several steps include in one single EZ-mode. I suggest you to separate match request test from it to avoid unknown issue.

    2. Yes, it means you already define it.

  • hi chen ,

                so ,could  you please draw me a flow chart as i ask before?

    please, 

    谢谢!

  • 1. When IAS zone joins Zigbee network, IAS zone broadcast Match request.

    2. If CIE receives match request, it would response match response.

    3. IAS zone receives match response and would know CIE address and end point for IAS zone report later.

  • 1. When IAS zone joins Zigbee network, IAS zone broadcast Match request.

    As you said ,disabled the Ez-Mode, So i put the ZDP_MatchDescReq replace Ez-mode while keypress

    , i also register ZDO_RegisterForZDOMsg(task_id, Match_Desc_rsp)。  all of those was coding  in Zone side 。

    2. If CIE receives match request, it would response match response.

    is that auto response by CIE? what i mean is  do we need to coding response in CIE side? 

    3. IAS zone receives match response and would know CIE address and end point for IAS zone report later.

    as i get those info in  zclIASZoneVibration_ProcessZDOMsgs()====》 ZDO_CB_MSG  in ZONE side

        uint16 shortaddr;
        char str[7];
        shortaddr =  pMsg->srcAddr.addr.shortAddr;
     
        sprintf(str,"CIE addr:%d",shortaddr);
        HalUARTWrite(0,str,8);
       
        osal_mem_free(pRsp);

    there is noting, so is that  i get the info in the wrong place?

     

    where  the response  info should be get ,   ZDO_CB_MSG or ZCL_INCOMING_MSG ???

     

    thanks!!!

  • 1&3. After you do these, you have to add "case Match_Desc_rsp:" in your zclSampleXXX_ProcessZDOMsgs to process it.

    void zclSampleXXX_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg )
    {
    switch ( inMsg->clusterID )
    {
    case Match_Desc_rsp:
    {
    ZDO_ActiveEndpointRsp_t *pRsp = ZDO_ParseEPListRsp( inMsg );
    if ( pRsp )
    {
    if ( pRsp->status == ZSuccess && pRsp->cnt )
    {
    zclSampleTest_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;
    zclSampleTest_DstAddr.addr.shortAddr = pRsp->nwkAddr;
    // Take the first endpoint, Can be changed to search through endpoints
    zclSampleTest_DstAddr.endPoint = pRsp->epList[}
    osal_mem_free( pRsp );
    }
    }
    break;
    }
    }

    2. Yes.

  • Hi chen

           is that the new define ???

          SampleTest_STATUS_CHANGE_EVT,
         zclSampleTest_SEND_MSG_TIMEOUT

     

         i have get nothing,

           

  • You don't need the following codes

    // Light LED
    HalLedSet( HAL_LED_4, HAL_LED_MODE_ON );
    osal_start_timerEx( zclSampleTest_TaskID,
    SampleTest_STATUS_CHANGE_EVT,
    zclSampleTest_SEND_MSG_TIMEOUT );

    You can remove it

  • Hi Chen

               please refer to the pic ,it seems  the Match rsp happen in CIE side ,and there is nothing rsp happen in ZONE side

  • I suggest you using Ubiqua Packet Analyzer to check over the air messages.

  • do you mean Pack sniffer Tool?

    but when i start it ,the CIE device could not press key any more。。。

  • Z-Stack Home is HA pofile and messages are encrypted. You have to use Ubiqua Packet Analyzer (http://www.ubilogix.com/products/ubiqua) to check the encryopted messages. By the way, is your CIE an end device too?

  • hi  Chen,

       do you mean i can't  read and send out the CIE addr to PC directly?

      but the question is ,the code  in ZONE side have  not run into zclIASZoneVibration_ProcessZDOMsgs

    My CIE  is  Coordinator,there is only two device , one is ZD (ZONE), another is ZC(CIE ).

    thanks!

  • I see that you still invoke EZ-mode in your test, I don't know which message invoke your ZDO_CB_MSG on CIE side. So, that is why I suggest you using Ubiqua Packet Analyzer to have a look.

  • Hi Chen,

              when CIE receive the enroll request from ZONE, how can i allocate a ZONE_ID for it?

               what can i do in the zclIASCIE_EnrollRequestCB in CIE coding side???

    static ZStatus_t zclIASCIE_EnrollRequestCB(zclZoneEnrollReq_t *pRep,uint8 endpoint )
    {
    #ifdef UartShow
    HalUARTWrite(0,"ZONE Enroll Request\n", sizeof("ZONE Enroll Request\n"));
    #endif

    ???

    ???

    ???

    }

  • It is automatically assigned in ZStatus_t zclSS_ProcessInCmd_ZoneStatus_EnrollRequest().

  • 1. so ,there is nothing need to do in  zclIASCIE_EnrollRequestCB call back function or put the ZStatus_t zclSS_ProcessInCmd_ZoneStatus_EnrollRequest(). into it ???

    2. why does CIE need to rewrite the CIE address into ZONE and WD? do you see in the fire alarm system sample

        The IAS CIE also sets the IAS CIE Address attribute of the IAS WD remotely by issuing a Send Write attribute command. This could have been accomplished locally in the IAS WD using the address of the incoming Zone Enroll Response, but the method using the Send Write Attribute command was used to illustrate this ZigBee Cluster Library functionality

        it is hard for us to coding this step!!!!

    3. when CIE receive change notification, How to send squawk to all WD ?

        as i think there should be a step to stroe all the WD address or something like ID which is idle and in network before sending squawk.

        and maybe zstack will automatically stroe those WD MSG when they enroll, but how to call back those msg for sending squawk ? 

        while there is not anything note in profile, could you please help us make it clearly。

  • 1. Yes, there is nothing needed to do.

    2. There are lots of alternatives to give CIE address to IAS zone and WD. Write CIE attribute is one. Match request and response is another.

    3. I would suggest CIE to send squawk command one by one to WD.

  • 1. Yes, there is nothing needed to do. ====》 that is so magical!!

    2. There are lots of alternatives to give CIE address to IAS zone and WD. Write CIE attribute is one. Match request and response is another. ====》 Maybe the EZMODE is more easy than other i think!!

    3. I would suggest CIE to send squawk command one by one to WD

         how could i send squawk command to WD??

     

    thanks,

  • 3. You can use API zclSS_Send_IAS_WD_SquawkCmd() in zcl_ss.h to send squawk command.

  • yes we know ,but when you want to send squawk command ,you should know how many WD had enrolled firstly,is that right?

    so  that is why i said:

    as i think there should be a step to stroe all the WD address or something like ID which is idle and in network before sending squawk.

    and the question is : when and how can we record the WD enrolled MSG ?