This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Zigbee IAS Zone example

Hi,

I need help to clarify the API for IAS zone server.  If I can get example implementation,  it would be great.   

I have hard time understanding how zb_ias_zone_app_callback_t work.  There is no documentation on it.  Yes,  I found a link to it that just says.

typedef zb_ret_t(* 

zb_ias_zone_app_callback_t )(zb_uint8_t param, zb_uint16_t general_val)

and

zb_void_t zb_zcl_ias_zone_register_cb ( zb_uint8_t  endpoint,
zb_callback_t  process_result_cb,
zb_ias_zone_app_callback_t  general_cb 
)

Registry callbacks to get status of Zone Status Change Notification command.

Parameters
endpoint - local endpoint number
process_result_cb - notification sent callback function
general_cb

- general callback function

So,  Is the call back is called on Zone Status Change?   If it is only for Zone Status Change Notification,  Can you help to clarify the parameter ZB_ZCL_VALID_CIE_ADDR_SET that may be set on the call back?

Please let me know how I can get a good documentation on how the callbacks (the general_cb and process_result_cb in respect to IAS Zone Server.   

Thanks

Iman

Parents
  • You can register a callback for the Zone Status Change notification or register a general function callback with params zb_zcl_general_zb_params_e

    I think we may have some miss understanding.  in IAS Zone cluster,  A server generate Zone Status Change Notification command.  It does not listen to Zone Status Change Notification command.

    I am writing a IAS Zone.   So,  your suggestion is to write the ZoneStatus attribute.  Then,  the stack will automatically send Zone Status Change Notification command.  Please confirm that this is what you mean?  I am confused now.

    I tried your suggestion as follow.  

        newValue = 1;
        ZB_ZCL_SET_ATTRIBUTE(MULTI_SENSOR_ENDPOINT, 
                           ZB_ZCL_CLUSTER_ID_IAS_ZONE,    
                           ZB_ZCL_CLUSTER_SERVER_ROLE,  
                           ZB_ZCL_ATTR_IAS_ZONE_ZONESTATUS_ID,
                           (zb_uint8_t *)&newValue,                        
                           ZB_FALSE);

    I don't think the stack send out Zone Status Change Notification command.

    Thank you for the help.   I hope you can clarify.

    Thanks

    Iman

Reply
  • You can register a callback for the Zone Status Change notification or register a general function callback with params zb_zcl_general_zb_params_e

    I think we may have some miss understanding.  in IAS Zone cluster,  A server generate Zone Status Change Notification command.  It does not listen to Zone Status Change Notification command.

    I am writing a IAS Zone.   So,  your suggestion is to write the ZoneStatus attribute.  Then,  the stack will automatically send Zone Status Change Notification command.  Please confirm that this is what you mean?  I am confused now.

    I tried your suggestion as follow.  

        newValue = 1;
        ZB_ZCL_SET_ATTRIBUTE(MULTI_SENSOR_ENDPOINT, 
                           ZB_ZCL_CLUSTER_ID_IAS_ZONE,    
                           ZB_ZCL_CLUSTER_SERVER_ROLE,  
                           ZB_ZCL_ATTR_IAS_ZONE_ZONESTATUS_ID,
                           (zb_uint8_t *)&newValue,                        
                           ZB_FALSE);

    I don't think the stack send out Zone Status Change Notification command.

    Thank you for the help.   I hope you can clarify.

    Thanks

    Iman

Children
  • Hi,

    I am sorry for the late reply. Did you manage to see the Zone Status Change Notification on the sniffer traffic after updating the ZoneStatus attribute?

    iharyadi said:
    So,  your suggestion is to write the ZoneStatus attribute.  Then,  the stack will automatically send Zone Status Change Notification command.  Please confirm that this is what you mean?

     Yes, this is exactly what the ZCL specification says, the stack should send the Zone Status Change notification when the ZoneStatus attribute changes: "The Zone Status Change Notification command is generated when a change takes place in one or more bits of the ZoneStatus attribute".

    Best regards,

    Marjeris

  • Hi Marjeris,

    Thank you for your update.  Just FYI,  I think the implementation (not specification) of the ZBOSS in nrf52840 does not automatically send the Zone Status Change when ZoneStatus attribute changes.  My code have to explicitly send zcl "Zone Status Change Notification" command in this case.

    In any case,  thank you for your help.   I am able to figure out the implementation slowly.  It would be helpful if you can still give all of us an example for IAS Zone.  We may produce better or proper implementation.

    Just FYI,  I am implementing the IAS Zone for a Gas Stove Sensor.  I am very happy with nrf52840.   It is a very good platform for what I am trying to do.

    https://www.linkedin.com/pulse/zigbee-gas-stove-sensor-iman-haryadi

    Thank you for all your help on this.

    br

    Iman

Related