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 Details on IAS ZONE Cluster

Other Parts Discussed in Thread: Z-STACK, CC2530

Hello,

         I am using Water Level Sensor in End device, Which needs to Send it's report Coordinator. Water level Sensor will Give one, if it contains water and Zero if there is no water. I found IAS ZONE cluster is comes under this Sensor. And  Cluster id is defined in Zstack as ZCL_CLUSTER_ID_SS_IAS_ZONE and i didn't Found Attribute ID of this. Then i went the DOC Zigbee Cluster library, In that attribute ID mentioned as 0x002a. But the Same id number is defined for ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_6_INTENSITY. Can any one suggest me how to use it in my Program.

  • You can refer to the fire detector example at http://processors.wiki.ti.com/index.php/Fire_Alarm_System.

  • Can i get a complete Source code as in Doorlock.

  • To get complete source code, you need to contact your local sales representative.

  • Dear YK C,

           I don't Want to use IAS WD Table and IAS CIE Address,I want to use simple MatchDescReq. And i don't need a warning messages also. I just want to send the water level to ZC. So My Code structure is, 

    4338.IAS_ZONE.c
    Coordinator:
    ------------
       #define ZCLSAMPLECIE_MAX_INCLUSTERS       2
    const cId_t zclSampleCIE_InClusterList[ZCLSAMPLECIE_MAX_INCLUSTERS] =
    {
      ZCL_CLUSTER_ID_GEN_BASIC,
      ZCL_CLUSTER_ID_GEN_IDENTIFY,
    };
     
    #define ZCLSAMPLECIE_MAX_OUTCLUSTERS       2
    const cId_t zclSampleCIE_OutClusterList[ZCLSAMPLECIE_MAX_OUTCLUSTERS] =
    {
      ZCL_CLUSTER_ID_GEN_IDENTIFY,
      ZCL_CLUSTER_ID_SS_IAS_ZONE
    };
     
     
    SimpleDescriptionFormat_t zclSampleCIE_SimpleDesc =
    {
      SAMPLECIE_ENDPOINT,                  //  int Endpoint;
      ZCL_HA_PROFILE_ID,                     //  uint16 AppProfId[2];
      ZCL_HA_DEVICEID_IAS_CONTROL_INDICATING_EQUIPMENT,        //  uint16 AppDeviceId[2];
      SAMPLECIE_DEVICE_VERSION,            //  int   AppDevVer:4;
      SAMPLECIE_FLAGS,                     //  int   AppFlags:4;
      ZCLSAMPLECIE_MAX_INCLUSTERS,         //  byte  AppNumInClusters;
      (cId_t *)zclSampleCIE_InClusterList, //  byte *pAppInClusterList;
      ZCLSAMPLECIE_MAX_OUTCLUSTERS,        //  byte  AppNumInClusters;
      (cId_t *)zclSampleCIE_OutClusterList //  byte *pAppInClusterList;
    };
    
    static zclGeneral_AppCallbacks_t zclSampleCIE_CmdCallbacks =
    {
      zclSampleLight_BasicResetCB,              // Basic Cluster Reset command
      zclSampleLight_IdentifyCB,                // Identify command  
      zclSampleLight_IdentifyQueryRspCB,        // Identify Query Response command
      zclSampleLight_OnOffCB,                   // On/Off cluster command
      NULL,                                     // Level Control Move to Level command
      NULL,                                     // Level Control Move command
      NULL,                                     // Level Control Step command
      NULL,                                     // Group Response commands
      NULL,                                     // Scene Store Request command
      NULL,                                     // Scene Recall Request command
      NULL,                                     // Scene Response command
      NULL,                                     // Alarm (Response) command
      zclSampleCIE_ChangeNotificationCB,                                     // RSSI Location commands
      NULL,                                     // RSSI Location Response commands
    };
    ------------------------------------------------------------------------------------------------------------------------------
    
    Sensor Device:
    -------------------------
    
    #define ZCLSAMPLEWATERDETECTOR_MAX_INCLUSTERS       3
    const cId_t zclSampleWaterDetector_InClusterList[ZCLSAMPLEFIREDETECTOR_MAX_INCLUSTERS] =
    {
      ZCL_CLUSTER_ID_GEN_BASIC,
      ZCL_CLUSTER_ID_GEN_IDENTIFY,
      ZCL_CLUSTER_ID_SS_IAS_ZONE,
    };
     
    SimpleDescriptionFormat_t zclSampleWaterDetector_SimpleDesc =
    {
      SAMPLEFIREDETECTOR_ENDPOINT,                  //  int Endpoint;
      ZCL_HA_PROFILE_ID,                     //  uint16 AppProfId[2];
      ZCL_HA_DEVICEID_IAS_WARNING_DEVICE,        //  uint16 AppDeviceId[2];
      SAMPLEFIREDETECTOR_DEVICE_VERSION,            //  int   AppDevVer:4;
      SAMPLEFIREDETECTOR_FLAGS,                     //  int   AppFlags:4;
      ZCLSAMPLEFIREDETECTOR_MAX_INCLUSTERS,         //  byte  AppNumInClusters;
      (cId_t *)zclSampleWaterDetector_InClusterList, //  byte *pAppInClusterList;
      0,                                            //  byte  AppNumInClusters;
      NULL,                                         //  byte *pAppInClusterList;
    };
    
    uint8 zclSampleWaterDetector_ZoneState = SS_IAS_ZONE_STATE_NOT_ENROLLED;
    uint16 zclSampleWaterDetector_ZoneType = SS_IAS_ZONE_TYPE_WATER_SENSOR;
    uint16 zclSampleWaterDetector_ZoneStatus = 0;
    //uint8 zclSampleWaterDetector_IAS_CIE_Address[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
     
    // IAS WD Cluster
    //uint16 zclSampleWaterDetector_MaxDuration = SAMPLEFIREDETECTOR_ALARM_MAX_DURATION;
     
    /*********************************************************************
     * ATTRIBUTE DEFINITIONS - Uses REAL cluster IDs
     */
    CONST zclAttrRec_t zclSampleWaterDetector_Attrs[SAMPLEWATERDETECTOR_MAX_ATTRIBUTES] =
    {
    [...]
    // *** Zone Cluster Attributes ***
      {
        ZCL_CLUSTER_ID_SS_IAS_ZONE,
        { // Attribute record
          ATTRID_SS_IAS_ZONE_STATE,
          ZCL_DATATYPE_ENUM8,
          ACCESS_CONTROL_READ,
          (void *)&zclSampleWaterDetector_ZoneState
        }
      },
     
       {
        ZCL_CLUSTER_ID_SS_IAS_ZONE,
        { // Attribute record
          ATTRID_SS_IAS_ZONE_TYPE,
          ZCL_DATATYPE_ENUM16,
          ACCESS_CONTROL_READ,
          (void *)&zclSampleWaterDetector_ZoneType
        }
      },
     
      {
        ZCL_CLUSTER_ID_SS_IAS_ZONE,
        { // Attribute record
          ATTRID_SS_IAS_ZONE_STATUS,
          ZCL_DATATYPE_BITMAP16,
          ACCESS_CONTROL_READ,
          (void *)&zclSampleWaterDetector_ZoneStatus
        }
      },
     
     /* {
        ZCL_CLUSTER_ID_SS_IAS_ZONE,
        { // Attribute record
          ATTRID_SS_IAS_CIE_ADDRESS,
          ZCL_DATATYPE_IEEE_ADDR,
          (ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
          (void *)zclSampleWaterDetector_IAS_CIE_Address
        }
      },
     
      // *** WD Cluster Attributes ***
     
       {
        ZCL_CLUSTER_ID_SS_IAS_WD,
        { // Attribute record
          ATTRID_SS_IAS_WD_MAXIMUM_DURATION,
          ZCL_DATATYPE_UINT16,
          (ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
          (void *)&zclSampleWaterDetector_MaxDuration
        }
      }*/
    };
    
    if(Senor_pin == 1)
    {
        zclSamplewaterDetector_SendChangeNotification();
    }
    
    static void zclSamplewaterDetector_SendChangeNotification( void )
    {
      
        
        //Toggle the zone status accoriding Sensor value
        zclSamplewaterDetector_ZoneStatus ^= SS_IAS_ZONE_STATUS_ALARM1_ALARMED;
     
        //now making the dst Address equal to the CIE_Addr attribute stored
        //if the address hasn't been changed yet
        if(zclCIE_IEEE_Addr.addrMode != (afAddrMode_t)Addr64Bit)
        { 
          zclCIE_IEEE_Addr.addrMode = (afAddrMode_t)Addr64Bit;
          osal_memcpy( zclCIE_IEEE_Addr.addr.extAddr, zclSamplewaterDetector_IAS_CIE_Address , Z_EXTADDR_LEN );
        }
     
        //generates a Zone Status Change Notification Command
        zclSS_IAS_Send_ZoneStatusChangeNotificationCmd(SAMPLEFIREDETECTOR_ENDPOINT,
                                                       &zclCIE_IEEE_Addr,
                                                       zclSamplewaterDetector_ZoneStatus, 0, 
                                                       1, 1 );
     
        if(zclSamplewaterDetector_ZoneStatus == SS_IAS_ZONE_STATUS_ALARM1_ALARMED)
        {
    #if defined( LCD_SUPPORTED )
    #ifdef HAL_BOARD_CC2538 
          HalLcdWriteString ("Fire", HAL_LCD_LINE_4);
          HalLcdWriteString ("Detected", HAL_LCD_LINE_5);
    #endif
    #ifdef HAL_MCU_CC2530
          HalLcdWriteString ("Fire", HAL_LCD_LINE_1);
          HalLcdWriteString ("Detected", HAL_LCD_LINE_2);
    #endif
    #endif
     
        }
        else
        {
    #if defined( LCD_SUPPORTED )
    #ifdef HAL_BOARD_CC2538 
          HalLcdWriteString ("Alarm", HAL_LCD_LINE_4);
          HalLcdWriteString ("Stopped", HAL_LCD_LINE_5);
    #endif
    #ifdef HAL_MCU_CC2530
          HalLcdWriteString ("Alarm", HAL_LCD_LINE_1);
          HalLcdWriteString ("Stopped", HAL_LCD_LINE_2);
    #endif
    #endif
     
        }
      }
    }
    . Could you verify it.

    1)Is that Code is valid

    2) zclSS_IAS_Send_ZoneStatusChangeNotificationCmd(SAMPLEFIREDETECTOR_ENDPOINT,
    &zclCIE_IEEE_Addr,
    zclSamplewaterDetector_ZoneStatus, 0,
    1, 1 );

    Instead of this, can i use the Addr which i got after Match_Desc_rsp.

    3)I need to add any Compile Option for IAS as we are adding for ZCL_REPORT.

            

  • 1. It looks no problem.

    2. Yes, you can use the Addr after Match_Desc_rsp

    3. Yes, you need to add compile Option ZCL_REPORT.

  • 1)When i register zclSampleCIE_ChangeNotificationCB(zclZoneChangeNotif_t *pCmd, afAddrType_t *srcAddr ) in 

    static zclGeneral_AppCallbacks_t zclSampleCIE_CmdCallbacks =
    {
    zclSampleCIE_BasicResetCB,              // Basic Cluster Reset command
    zclSampleCIE_IdentifyCB,                      // Identify command
    NULL,                                                             // Identify Trigger Effect command
    zclSampleCIE_IdentifyQueryRspCB,     // Identify Query Response command
    NULL,                                                              // On/Off cluster command
    NULL,                                                              // Level Control Move to Level command
    NULL,                                                             // Level Control Move command
    NULL,                                                             // Level Control Step command
    NULL,                                                             // Group Response commands
    NULL,                                                             // Scene Store Request command
    NULL,                                                             // Scene Recall Request command
    NULL,                                                             // Scene Response command
     zclSampleCIE_ChangeNotificationCB,  // Alarm (Response) command
    NULL,                                                             // RSSI Location commands
    NULL,                                                              // RSSI Location Response commands
    };

    It's giving error a value of type "void(*)(struct<unnamed>*) cannot be used to initialize an entity of type "zclGCB_Alarm_t"

  • You shouldn't put zclSampleCIE_ChangeNotificationCB in zclSampleCIE_CmdCallbacks because zclSampleCIE_CmdCallbacks doesn't handle this callback type. In my coordinator, I process it in ZCL_INCOMING_MSG of event loop.

  • Already i am receiving a MSgs from Other Enddevice, which is Sending the data to coordinator.

    case ZCL_INCOMING_MSG:
    // Incoming ZCL Foundation command/response messages
    zclSampleLight_ProcessIncomingMsg( (zclIncomingMsg_t *)MSGpkt );

    static void zclSampleLight_ProcessIncomingMsg( zclIncomingMsg_t *pInMsg)
    {                                                                                                                                                                                                                       .........                                                                                                                                                                                                     ..........

        

    case ZCL_CMD_REPORT:
    zclSampleLight_ProcessInReportCmd( pInMsg );

    }

    static void zclSampleLight_ProcessInReportCmd( zclIncomingMsg_t *pInMsg )
    {

    if(pInMsg->clusterId == ZCL_CLUSTER_ID_SS_IAS_ZONE)

    {

    zclZoneChangeNotif_t *pcmd;                                                                                                                                              pcmd = (zclZoneChangeNotif_t)pInMsg->attrCmd;                                                                                                                   switch(pcmd->zoneStatus)                                                                                                                                                                  {................}                                                                                                                                                                                        }

    else

    {
    zclReportCmd_t *pReportCmd;
    pReportCmd = (zclReportCmd_t *)pInMsg->attrCmd;

    if (pReportCmd->attrList[0].attrID ==  ...............)                                                                                                                           {

       .........................//Two sensor is sending the data where i am processing here

    }

    But i am not getting a report of IAS. Whether i should do any thing in the Sensor Device?

    how to config a report Sensor Device?I have done this.

    case ZCL_CMD_CONFIG_REPORT:
    zclWaterDetector_ProcessInConfigReportCmd( pInMsg );

    static void zclWaterDetector_ProcessInConfigReportCmd( zclIncomingMsg_t *pInMsg )
    {
    zclCfgReportCmd_t *pCfgReportCmd;
    zclCfgReportRspCmd_t cfgReportRsp;

    pCfgReportCmd = (zclCfgReportCmd_t *)pInMsg->attrCmd;

    osal_memcpy (&zclWaterDetector_ReportedAttr,
    &pCfgReportCmd->attrList[0],
    sizeof(zclCfgReportRec_t));

    // save report attributes and start a timer to send report periodically
    zclWaterDetector_ReportInt = 2;
    osal_start_timerEx( zclWaterDetector_TaskID,
    WaterDetector_PERIOIDICAL_REPORT_EVT,
    zclWaterDetector_ReportInt * 1000 );

    // save the dstAddress
    osal_memcpy(&zclWaterDetector_DstAddr,
    &pInMsg->srcAddr,
    sizeof(afAddrType_t));

    // send config report response
    cfgReportRsp.numAttr = 1;
    cfgReportRsp.attrList[0].status = ZCL_STATUS_SUCCESS;
    cfgReportRsp.attrList[0].direction = 1;
    cfgReportRsp.attrList[0].attrID = SS_IAS_ZONE_TYPE_WATER_SENSOR;
    zcl_SendConfigReportRspCmd (WaterDetector_ENDPOINT,
    &WaterDetectorr_DstAddr,
    ZCL_CLUSTER_ID_SS_IAS_ZONE,
    &cfgReportRsp,
    1, 0, 1);

    }

     I should do any other stuff?

  • ZCL_CMD_CONFIG_REPORT doesn't work like you do.  The fire detector example has.shown you how to send out IAS zone report. Please study it thoroughly.

  • In this Example http://processors.wiki.ti.com/index.php/Fire_Alarm_System. I don't see any config or enroll response in this. I Could able able to see only  zclSS_IAS_Send_ZoneStatusChangeNotificationCmd,   Which i have created Separate Event for that. 

         if(event &  SEND_STATUS_EVT)

          {

             zclSampleFireDetector_SendChangeNotification();

            return (event ^ SEND_STATUS_EVT);

    }

    1)Coordinator side is ok?

    2)In Sensor Device side, Any enroll response i need to process?. I don't have full Source Code. I have just seen this example and i made this. If u have full Source code, can share me.

  • I don't have source code of fire detector. As I suggest in previous post, you can contact your local TI sales representative to get it.

  • 1)Instead of Getting ZCL_CMD_CONFIG_REPORT, What response will get for config from coordinator?. and how to should process?. Is my code is valid for sending IAS report?

      if(event &  SEND_STATUS_EVT)

          {

             zclSampleFireDetector_SendChangeNotification();

            return (event ^ SEND_STATUS_EVT);

    }

    2)In that example, it is mentioned for IAS WD table(match Desc req and match Desc rsp), it is mandatory to use that, since i am not sending any warning msg to ZED. I am using default match Desc req and match Desc rsp in HA profile. 

         So can you guide me to fulfill my point number 1. 

  • 1. It is OK with your SEND_STATUS_EVT or without it. You just make your ZED call zclSamplewaterDetector_SendChangeNotification when "if(Senor_pin == 1)" is true.

  • Thank you, right now i am simulating the sensor with joystick. I am handling that in key Events. I Got points. So can you suggest me how to use. 

    After all init Steps, 

    ->The sensor or keyfob then sends a Match Descriptor Request for HA Profile, IAS Zone Cluster to 

    the coordinator.

    ->The device verifies that the Match Descriptor Response indicates that the IAS Zone Cluster client 

    is supported

    ->It is expected that the coordinator will discover that the device supports the IAS Zone cluster
    server. The sensor device waits for the Coordinator to set the device’s IAS Zone
    Cluster::IAS_CIE_ADDRESS_ATTRIBUTE (ID = 0x0010) with the address of the CIE. 

    1) This points States, we need to use,  zclSampleCIE_WriteIAS_CIE_Address function in coordinator which is in example. Will you suggest me, where to use it in coordinator.

    ->After the Coordinator sets the device’s IAS_CIE_ADDRESS_ATTRIBUTE, the device will send an IAS Zone::Enroll Request message to the CIE

    2) This request is send in zclSampleCIE_WriteIAS_CIE_Address itself, am i right?

    3)The points 1 and 2 can be neglect if Coordinator send req default, as it is doing for other Sensor like temperature and others, if i don't want WD message?? or it is mandatory for IAS? 

    ->In response, the ZED should send an IAS Zone::Enroll Response message, whereby it assigns the device its Zone ID

    ->The device sets its IAS Zone::Zone State attribute value to 1 to indicate that it is enrolled. It also stores the Zone ID value received in the Enroll Response message

    4)what is the MACRO for this like we are getting for other sensor ZCL_CMD_CONFIG_REPORT, where we need to set a numattr =1 and send a enroll reponse from ZED.

    Is i am Confusing with my question? if It so, Then i will Specify my problem more clearly.

  • Have you ever study Zigbee related specs? I suggest you to read them and also the book "zigbee wireless networking". You can find answers in these documents.

  • My questions is marked with red, not the all points. Yes i studied Zigbee related specs. I hope you understand where i stuck, This question is related to IAS stuff and Zstack, where they have defined the macro's.

  • Your question is very broad and I would suggest you to focus on them one by one. If you want to know more about ZCL_CMD_CONFIG_REPORT, I would suggest you can download the Thermostat Example at http://processors.wiki.ti.com/images/0/01/Z-Stack_Home_Automation_Thermostat_Example.zip. There are example codes of ZCL_CMD_CONFIG_REPORT and you also can refer to the ZCL spec.

  • Thanks again, I have already worked with that, by getting the temperature and humidity Sensor. I know about ZCL_CMD_CONFIG_REPORT. I think if i share my code, then you will find out.

                     In that code i  processed the ZCL_CMD_CONFIG_REPORT before sending IAS Zone status.  ZCL_CMD_CONFIG_REPORT, which will not work in IAS ZONE. That is the place i am not able to push. So, how can i get a enroll request from ZC, and ZED should Send response(this process is the ZCL_CMD_CONFIG_REPORT for sensor like temp and humidity).

                       My question for IAS ZONE enroll rsp. The only question is Instead of ZCL_CMD_CONFIG_REPORT, what should i do for sending enroll response. You can refer my code 1351.Back.rar

  • As I know, you can't send enroll to ZED. Anyway, why do you need to use ZCL_CMD_CONFIG_REPORT in IAS zone? Basically, you don't need it.

  • Is my Code is Valid for Sending a IAS Zone report,without ZCL_CONFIG_REPORT?. or else i need to any modification in that. I think i have already post my code for coordinator, how to receive a IAS notification. But why still it is not receiving Data? 

  • Is my Code is Valid for Sending a IAS Zone report,without ZCL_CONFIG_REPORT?. or else i need to any modification in that. I think i have already post my code for coordinator, how to receive a IAS notification. But why still it is not receiving Data? 

     Here the code of Coordinator, i have tried with two methods, One i have process through incoming msg, Which i have commented in my code, and other by callback function which i registered for SS.3666.Source.rar. Where should i make a change? in ZC or ZED.  

  • Is my code is valid??

  • For ZED, there should be no problem. For ZC, the IAS zone report should be process in 

    zclSampleLight_ProcessInReportCmd and I see you comment out all of the code inside.

  • Thanks YK C,

    Yes, i commented it. I didn't Process in zclSampleLight_ProcessInReportCmd. I am getting the IAS Report in callback function. I have registered another call back function zclSS_RegisterCmdCallbacks(NotificationCB) in Init and i added ZCL_ZONE in preprocessor. Now i am able to get a report. Thanks for your Help and kind Reply YK C.

  • Hi Chen!

                i have some problem of the fire detector example as below:

                1.  static void zclIASZoneVibration_SendChangeNotification( void )
    {
       // 如果没有enrolled 呢?
      if(zclIASZoneVibration_ZoneState == SS_IAS_ZONE_STATE_ENROLLED
         && !(osal_ExtAddrEqual( broadExtAddr, zclIASZoneVibration_IAS_CIE_Address)) )
      {
          。。。
        }
    }

                  when does IAS Zone send enrolled request? 

                  and  if the IAS Zone enrolled doesn't success, how can i do?

                  what is the broadExtAddr ? where is its define?why does it need to compare IAS_CIE_Address?

     2. static void zclIASZoneVibration_SquawkCB(zclCmdSSWDSquawkPayload_t squawks)

          what is the zclCmdSSWDSquawkPayload_t 

          i can't find any define in zcl_ss.h , i can only find  squawkbits_t, is that right ?

          where can i  sign this function? it doesn't like gerneral.....

    could you please help me ??? a log of question , is there a complete example code?

    how can i detecte the TI  support Eg?

     

  • Hi Chen ,

              i find the example of fire detector in TI wiki 。

             but that is too old

               when i use  the function :zclSS_IAS_Send_ZoneStatusChangeNotificationCmd 
     

             there is  a  Zone ID param , i don't konw how to get the Zone ID and use in this function as param????

    THS

  • hi chen

         when i use the call back funtion to get the enroll response info ,as below

         static ZStatus_t zclIASZoneVibration_EnrollRspCB(zclZoneEnrollRsp_t *pRsp )
    {
      //判断IAS Zone or WD 是否登记成功
      switch (pRsp->responseCode)
      {
         case SS_IAS_ZONE_STATUS_ENROLL_RESPONSE_CODE_SUCCESS :
                VibrationZoneID = pRsp->zoneID;
           break;  
    //     case SS_IAS_ZONE_STATUS_ENROLL_RESPONSE_CODE_NOT_SUPPORTED:
    //       // 不支持
    //       break;
    //     case SS_IAS_ZONE_STATUS_ENROLL_RESPONSE_CODE_NO_ENROLL_PERMIT:
    //       //无权限
    //       break;
    //     case SS_IAS_ZONE_STATUS_ENROLL_RESPONSE_CODE_TOO_MANY_ZONES:
    //       //超出数量
    //       break;
          default:
           ZStatus_t zclSS_IAS_Send_ZoneStatusEnrollRequestCmd( IASZoneVibration_ENDPOINT, zclIASZoneVibration_IAS_CIE_Address
                                                         SS_IAS_ZONE_TYPE_VIBRATION_MOVEMENT_SENSOR, zclIASZoneVibration_ManufacturerCode
                                                         1, 1 )
           break;
      }

    it aways show me that  the color line was error

    Error[Pe007]: unrecognized token

    and there is another question :

    if  i judge enroll request failed ,i need to send the enroll request again, then using function

    zclSS_IAS_Send_ZoneStatusEnrollRequestCmd

    in this function there need to set the zone ID and the dst address,

    it is so strange ,zone ID is set by ACE,if enroll faild   what can i set this zone ID to the this function for send enroll request again

  • hi chen ,it is me again!!!!

               i read the zcl sepc, there is a question about the IAS zone Sending the Enroll request。 

               it said as below :

               The Zone Enroll Request command is generated when a device embodying the
    Zone server cluster wishes to be enrolled as an active alarm device. It must do this
    immediately it has joined the network (during commissioning)

     
                but it doesn't clear, when the IAS Zone join in the net, when and where can i use  the

               zclSS_IAS_Send_ZoneStatusEnrollRequestCmd() function to send the enroll request?

               anymore,the function   zclSS_IAS_Send_ZoneStatusEnrollRequestCmd() use the

               parameter   afAddrType_t *dstAddr, 

               this is the first time i try to enroll, how can i konw the dstAdd??????

               it is a big big big  ideological confusion

             wish you have see my note!!!!!!wish there is a hand for me~~~~~~

     

  • You can send enroll in ZDO_STATE_CHANGE.

  •  

    thank you very much !

             and  i think  i can send the enroll request  here    in event loop function

               // now on the network
              if ( (zclSampleLight_NwkState == DEV_ZB_COORD) ||
                   (zclSampleLight_NwkState == DEV_ROUTER)   ||
                   (zclSampleLight_NwkState == DEV_END_DEVICE) )
              {
                giLightScreenMode = LIGHT_MAINMODE;
                zclSampleLight_LcdDisplayUpdate();
    #ifdef ZCL_EZMODE
                zcl_EZModeAction( EZMODE_ACTION_NETWORK_STARTED, NULL );
    #endif // ZCL_EZMODE
              }

     

             but  i  aways don't konw  where  is  the  afAddrType_t *dstAddr paramter?

            how can i get this one ?

    ths

     

  • What do you mean don't know where  is  the  afAddrType_t *dstAddr paramter? Can you be more specific on your question?

  • thanks!

              i mean when i use this function,what value should be put in this  *dstAddr  parameter?

              and could you please show the IAS working procedure for me?

              first step  , second step,and so on!!

    thanks!

  • You should fill dstAddr like the followings (// If you want to enroll this IAS zone device to coordinator, the short address of coordinator is 0x0000.):

    dstAddr.addrMode=(afAddrMode_t)Addr16Bit;

    dstAddr.endPoint= XXX; //destination end point.

    dstAddr.addr.shortAddr=0x0000;

  • en..

          could you please help me summarize the process of IAS_ZONE  while working and aslo the process of IAS_CIE.

    thanks



  • I suggest you to read Zgibee cluster library specification and home automation profile specification to get familiar with IAS Zone and IAS CIE devices.

  • when i set the dstAddr like you said, i am curious about the IAS_CIE_Address which define in the xxx_data.c file

    have you even seen the fire Alarm system sample code in TI wiki ,

    it said  "the IAS WD automatically sends a Zone Enroll Request message to the IAS CIE, which adds an entry for that zone to its Zone Table and sends a Zone Enroll Response message back notifying the result of the operation."

    I always get mixed up whether do i need to send enroll or not>>>>

     

  • hi Chen sir!

             when the CIE use the call back function  zclIASCIE_EnrollRequestCB(zclZoneEnrollReq_t *pRsp )   to response the ZONE enroll request,

              what should i do in this function?how can i allocat a ZONE_ID for the enroll request ZONE?

              anyway  should i do this step? if i have not response ,does it matter?

     

    thank you???

     

  • IAS WD/zone device must send enroll request. When CIE receives enroll request, it has to assign a unique zone ID to the device and keep the device in its enrolled list. It doesn't matter if you don't send enroll response. However, I still suggest you to send enroll response.

  • Mr Chen ,

                the question is i don't know  how to response the enroll request? what should i do in this call back function?

    thanks

  • If you enable ZCL_ZONE in Z-Stack, it is handled automatically in zclSS_ProcessInCmd_ZoneStatus_EnrollRequest().

  • do you mean i use zclSS_ProcessInCmd_ZoneStatus_EnrollRequest()  in the  sampleCIE.c  enroll request call back function?

  • 1. You have to define ZCL_ZONE.

    2. You have to register callback function with zclSS_RegisterCmdCallbacks() in CIE Init.

  • 1. You have to define ZCL_ZONE.    ------    yes  i  did

    2. You have to register callback function with zclSS_RegisterCmdCallbacks() in CIE Init ---- yes i always have register this in sampleZONE.c and sampleCIE.c

    in sampleZONE.c 

    1. send the enroll request           =====》 use zclSS_IAS_Send_ZoneStatusEnrollRequestCmd() in  ZDO_STATE_CHANGE  when service on network

    2. check the call back enroll response function,get the ZONE_ID ====》use zclSS_ProcessInCmd_ZoneStatus_EnrollResponse() in zclIASZoneVibration_EnrollRspCB()when CIE feedback 

    3. send zclIASZoneVibration_SendChangeNotification();=====》 when status change

    in sampleCIE.c :

    1. ????

    2。????

    3.????

    i don't know what the CIE should do ,and use which function?

  • in sampleCIE.c :

    1. Define ZCL_ZONE.

    2. Register callback function with zclSS_RegisterCmdCallbacks(SSCallback).

    3. When CIE receive enroll request in SSCallback, you can do what you want.

  • hi chen,

              i found there is writing CIE address step  in fire alarm system sample code。

             it said :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.

              i don't know when and where i should  do this step?

    thanks

  • When you receive enroll response on IAS WD, it must come from CIE and you know its address. So, you can use this address to write CIE address locally.

  • hi chen ,

               locally??  you mean the WD write CIE address by itself?

              but fire alarm system sample was  CIE use Send Write Attribute command to set WD  CIE address。

               what is the purpose of this operation ??

  • Yes, I mean the WD to write CIE address by itself. I have explained it in previous answer. If WD receives enroll response, it would have CIE address to write by itself. However, the normal way is to config CIE address by sending write attribute command.

  • hi chen ,

           when alarm happen ,where could i use zclIASZoneVibration_SendChangeNotification(), i think it should be a sytterm event as like KEYCHANGE, but i don‘t know how to put this function in system event loop checking。。。。

    thanks

  • No, it is not related to any system event. In general, we wire a vibration sensor to CC2530 GPI. When GPI interrupt is triggered which means there is vibration, you can call zclIASZoneVibration_SendChangeNotification.