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

Problem with Configure reporting attribute

Hello,

I have a problem with reporting attribute:
I am currently implementing a custom cluster that has 5 attributes that are reportable. Attribute values ​​are of the type signed32bit, so they are part of the "Analog" category, ie they support the request for Reportable Change. At the moment, I want the values ​​of the attributes that I request to be sent: just 3 out of 5. I want to configure the reporting only after sending a configure reporting command and I want to configure threshold reporting, then setting reportable change. To do this, I set the minimum interval to 1, the maximum interval to 0 and the reportable change to the value chosen by me.
At the moment, taking the example of the MultiSensor in conjunction with the CLI, the phases I perform are:

1) opening of the network by the coordinator

2) connection of the device to the coordinator

3) Match Descriptor Request to find the endpoint of the device just connected

4) Extended Address Request to the connected device to obtain the Long Address of the connected device

5) Binding Request and configure reporting of the attributes chosen by me.


What happens is that, after binding, even before I can send a Configure Reporting Command, the device responds immediately with a Report Attributes Command, sending the values ​​of all the attributes.

After I can send the Configure Reporting Commands, the attribute starts to report every second the value without considering my Reportable Change.

I can't understand if I'm doing something wrong in the passages or in the declaration of the attribute that is reportable.
Is there any setting I need to change to prevent reporting from being automatic?
And how come I can't get Reportable Change respected?
I enclose the declaration of the custom attribute.

#define ZB_SET_ATTR_DESCR_WITH_ZB_ZCL_CUSTOM_CLUSTER_ATTR_MEASURED_VALUE_1_ID(data_ptr)\
{                                                                                   \
  ZB_ZCL_CUSTOM_CLUSTER_ATTR_MEASURED_VALUE_1_ID,                                   \
  ZB_ZCL_ATTR_TYPE_S32,                                                             \
  ZB_ZCL_ATTR_ACCESS_READ_ONLY | ZB_ZCL_ATTR_ACCESS_REPORTING,                      \
  (zb_voidp_t) data_ptr                                                             \
}

I enclose the function that I use for sending the Configure Reporting Attribute:

typedef struct {
    zb_uint16_t profile_id;
    zb_uint16_t cluster_id;
    zb_uint16_t attr_id;
    zb_uint8_t  attr_type;
    zb_uint16_t interval_min;
    zb_uint16_t interval_max;
    zb_addr_u   remote_node;
    addr_type_t remote_addr_mode;
    zb_uint8_t  remote_ep;
    zb_int32_t reportable_change;
} configure_reporting_req_t;


static zb_void_t reporting_attr(zb_uint8_t param)
{
    zb_buf_t                  * p_buf = ZB_GET_OUT_BUF();
    configure_reporting_req_t   req;
    zb_uint8_t                * p_cmd_ptr;
    zb_ret_t                    zb_err_code;

  if (!p_buf)
    {
        printf("Failed to execute command (buf alloc failed)\n");
        return;
    }
               
    req.profile_id = m_attr_table[item].profile_id;
    req.cluster_id = m_attr_table[item].cluster_id;

    req.attr_id = m_attr_table[item].attr1_id;
    req.attr_type = m_attr_table[item].attr1_type;

    req.interval_min = 1;
    req.interval_max = 0;
    req.reportable_change = 150; 

    //ZB_MEMCPY(req.remote_node.addr_long,m_attr_table[item].remote_ieee_addr,sizeof(zb_ieee_addr_t));
    req.remote_node.addr_short = m_attr_table[item].remote_short_address;
    req.remote_addr_mode = ZB_APS_ADDR_MODE_16_ENDP_PRESENT;
    req.remote_ep = m_attr_table[item].remote_ep;

    ZB_ZCL_GENERAL_INIT_CONFIGURE_REPORTING_SRV_REQ(p_buf,
                                                    p_cmd_ptr,
                                                    ZB_ZCL_ENABLE_DEFAULT_RESPONSE);

    ZB_ZCL_GENERAL_ADD_SEND_REPORT_CONFIGURE_REPORTING_REQ(p_cmd_ptr,
        req.attr_id, req.attr_type, req.interval_min, req.interval_max,
        &req.reportable_change);

    ZB_ZCL_GENERAL_SEND_CONFIGURE_REPORTING_REQ(p_buf, p_cmd_ptr,
        req.remote_node, req.remote_addr_mode, req.remote_ep, HA_TEMP_SENSOR_ENDPOINT,
        req.profile_id, req.cluster_id, NULL);
}

I hope I attached everything useful for helping me to resolve my problem.

Thank you so much and best regards,

Raffaela

Parents Reply Children
No Data
Related