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

Zigbee reporting not work while using multiple endpoints

Hello,

I just started to understand Zigbee and I had some problem. I created 3 endpoints. In one of them (endpoint counter_ep) I need a attribute reporting. A reporting works well only if this endpoint is the last in the list of macro parameters ZBOSS_DECLARE_DEVICE_CTX_3_EP or the only one in the macro ZBOSS_DECLARE_DEVICE_CTX_1_EP, otherwise reports will be unstable (for example, only 1 out of 10 reports will be received). Please tell me what could be the problem. I already found a similar problem on your forum, but the question has been deleted.

Thanks in advance.

I am using nrf52840 chip, SDK 4.0.0, router.
Coordinator: nrf52840, SDK 4.0.0, CLI example.

Examples:
counter_ep - endpoint with report.

Works:

ZBOSS_DECLARE_DEVICE_CTX_3_EP (counter_ctx, duty_ep, leds_ep, counter_ep);

or
ZBOSS_DECLARE_DEVICE_CTX_1_EP (counter_ctx, counter_ep);

Does not work:

ZBOSS_DECLARE_DEVICE_CTX_3_EP (counter_ctx, counter_ep, duty_ep, leds_ep);

or
ZBOSS_DECLARE_DEVICE_CTX_3_EP (counter_ctx, duty_ep counter_ep, leds_ep);

or
ZBOSS_DECLARE_DEVICE_CTX_2_EP (counter_ctx, counter_ep, leds_ep);

or
ZBOSS_DECLARE_DEVICE_CTX_2_EP (counter_ctx, counter_ep, duty_ep);

Parents
  • Hi Nikita

    I asked one of our devs to try to explain how endpoints should be declared correctly, and here is what they said:

    In general, when each endpoint is declared, there is an array in its endpoint_descr which is reporting the stored configuration. We need to store reporting configs for all reportable attributes on each endpoint.

    What you seem to have done is that you have one array large enough to store all reporting configs for all reportable attributes.

    If you check out the ble_zigbee_dynamic_color_light_bulb_thingy, this is the approach that is recommended by our developers: This example stores reporting attributes in separate arrays for each endpoint. This is the cleanest solution as there are no dependencies between endpoints. The only problem is that the name of each array needs to be unique. In the example, ep_name is used to create each array name so that it is unique. This leads to fewer dependencies and makes it easier to understand what is going on. Keep in mind that macros to declare endpoints need to be redefined.

    Best regards,

    Simon

Reply
  • Hi Nikita

    I asked one of our devs to try to explain how endpoints should be declared correctly, and here is what they said:

    In general, when each endpoint is declared, there is an array in its endpoint_descr which is reporting the stored configuration. We need to store reporting configs for all reportable attributes on each endpoint.

    What you seem to have done is that you have one array large enough to store all reporting configs for all reportable attributes.

    If you check out the ble_zigbee_dynamic_color_light_bulb_thingy, this is the approach that is recommended by our developers: This example stores reporting attributes in separate arrays for each endpoint. This is the cleanest solution as there are no dependencies between endpoints. The only problem is that the name of each array needs to be unique. In the example, ep_name is used to create each array name so that it is unique. This leads to fewer dependencies and makes it easier to understand what is going on. Keep in mind that macros to declare endpoints need to be redefined.

    Best regards,

    Simon

Children
  • Hello,

    Thanks for the detailed answer.

    All that you just told me about - I have already been implemented initially. Each endpoint has its own individual array of reports. And attribute reporting worked only at that endpoint, which is the last in the argument list of the macro ZBOSS_DECLARE_DEVICE_CTX_3_EP.

    ZBOSS_DECLARE_DEVICE_CTX_3_EP(ucounter_ctx, duty_ep, leds_ep, counter_ep); // Attribute reporting for endpoint counter_ep works fine because counter_ep is listed last in the list.

    But I looked example that you advise (ble_zigbee_dynamic_color_light_bulb_thingy) and I noticed in the declaration of the end point is a little different macros (ZB_DECLARE_SIMPLE_DESC_VA(3 Arg) and ZB_AF_SIMPLE_DESC_TYPE_VA(3 args) instead ZB_DECLARE_SIMPLE_DESC(2 args) and ZB_AF_SIMPLE_DESC_TYPE(2 args)):

    #define ZB_ZCL_DECLARE_COLOR_DIMMABLE_LIGHT_SIMPLE_DESC(ep_name, ep_id, in_clust_num, out_clust_num)             \
        ZB_DECLARE_SIMPLE_DESC_VA(in_clust_num, out_clust_num, ep_name);                            \
        ZB_AF_SIMPLE_DESC_TYPE_VA(in_clust_num, out_clust_num, ep_name)  simple_desc_## ep_name =   \
        {                                                                                           \
           ...                                                                                      \
        }

    I redid all his declarations, checked everything for differences and ran the code, and it again stopped working:

    .h:

    #ifndef ZB_COUNTING_H_
    #define ZB_COUNTING_H_
    
    #include "zboss_api.h"
    #include "zboss_api_addons.h"
    
    #include "zb_zcl_analog_input.h"
    #include "zb_zcl_multistate_value.h"
    #include "zb_zcl_binary_value.h"
    #include "zb_zcl_multistate_input.h"
    
    #define ZB_DEVICE_VER                        1
    
    /* COUNTER EndPoint  */
    #define ZB_COUNTER_EP                        10                  /**< Device endpoint. */
    #define ZB_COUNTER_EP_REPORT_ATTR_COUNT      4                   /**< Number of attributes mandatory for reporting in cluster. */
    #define ZB_COUNTER_EP_IN_CLUSTER_NUM         4                   /**< Number of the input (server) clusters in the multisensor device. */
    #define ZB_COUNTER_EP_OUT_CLUSTER_NUM        0                   /**< Number of the output (client) clusters in the multisensor device. */
    
    /* DUTY EndPoint */
    #define ZB_DUTY_EP                           11                  /**< Device endpoint. */
    #define ZB_DUTY_EP_REPORT_ATTR_COUNT         2                   /**< Number of attributes mandatory for reporting in cluster. */
    #define ZB_DUTY_EP_IN_CLUSTER_NUM            3                   /**< Number of the input (server) clusters in the multisensor device. */
    #define ZB_DUTY_EP_OUT_CLUSTER_NUM           0                   /**< Number of the output (client) clusters in the multisensor device. */
    
    /* LEDS EndPoint */
    #define ZB_LEDS_EP                           12                  /**< Device endpoint. */
    #define ZB_LEDS_EP_REPORT_ATTR_COUNT         4                   /**< Number of attributes mandatory for reporting in cluster. */
    #define ZB_LEDS_EP_IN_CLUSTER_NUM            5                   /**< Number of the input (server) clusters in the multisensor device. */
    #define ZB_LEDS_EP_OUT_CLUSTER_NUM           0                   /**< Number of the output (client) clusters in the multisensor device. */
    #define ZB_LEDS_EP_LIGHT_CVC_ATTR_COUNT      1
    
    /* -------------------------------------------- COUNTER ENDPOINT DECLARE ---------------------------------------------------------- */
    
    /** @brief Declares cluster list for the COUNTER EndPoint.
     *
     *  @param cluster_list_name            Cluster list variable name.
     *  @param basic_attr_list              Attribute list for the Basic cluster.
     *  @param identify_attr_list           Attribute list for the Identify cluster.
     *  @param counter_attr_list            Attribute list for the Analog Input cluster.
     *  @param pulse_in_kwh_attr_list       Attribute list for the Multistate Value cluster.
     */
    #define ZB_DECLARE_COUNTER_CLUSTER_LIST(                            \
          cluster_list_name,                                            \
          basic_attr_list,                                              \
          identify_attr_list,                                           \
          counter_attr_list,                                            \
          pulse_in_kwh_attr_list)                                       \
          zb_zcl_cluster_desc_t cluster_list_name[] =                   \
          {                                                             \
            ZB_ZCL_CLUSTER_DESC(                                        \
              ZB_ZCL_CLUSTER_ID_BASIC,                                  \
              ZB_ZCL_ARRAY_SIZE(basic_attr_list, zb_zcl_attr_t),        \
              (basic_attr_list),                                        \
              ZB_ZCL_CLUSTER_SERVER_ROLE,                               \
              ZB_ZCL_MANUF_CODE_INVALID                                 \
            ),                                                          \
            ZB_ZCL_CLUSTER_DESC(                                        \
              ZB_ZCL_CLUSTER_ID_IDENTIFY,                               \
              ZB_ZCL_ARRAY_SIZE(identify_attr_list, zb_zcl_attr_t),     \
              (identify_attr_list),                                     \
              ZB_ZCL_CLUSTER_SERVER_ROLE,                               \
              ZB_ZCL_MANUF_CODE_INVALID                                 \
            ),                                                          \
            ZB_ZCL_CLUSTER_DESC(                                        \
              ZB_ZCL_CLUSTER_ID_ANALOG_INPUT,                           \
              ZB_ZCL_ARRAY_SIZE(counter_attr_list, zb_zcl_attr_t),      \
              (counter_attr_list),                                      \
              ZB_ZCL_CLUSTER_SERVER_ROLE,                               \
              ZB_ZCL_MANUF_CODE_INVALID                                 \
            ),                                                          \
            ZB_ZCL_CLUSTER_DESC(                                        \
              ZB_ZCL_CLUSTER_ID_MULTI_VALUE,                            \
              ZB_ZCL_ARRAY_SIZE(pulse_in_kwh_attr_list, zb_zcl_attr_t), \
              (pulse_in_kwh_attr_list),                                 \
              ZB_ZCL_CLUSTER_SERVER_ROLE,                               \
              ZB_ZCL_MANUF_CODE_INVALID                                 \
            )                                                           \
          }
    
    /** @brief Declares simple descriptor for the COUNTER EndPoint.
     *  
     *  @param ep_name          Endpoint variable name.
     *  @param ep_id            Endpoint ID.
     *  @param in_clust_num     Number of the supported input clusters.
     *  @param out_clust_num    Number of the supported output clusters.
     */
    #define ZB_DECLARE_COUNTER_DESC(ep_name, ep_id, in_clust_num, out_clust_num)               \
      ZB_DECLARE_SIMPLE_DESC_VA(in_clust_num, out_clust_num, ep_name);                         \
      ZB_AF_SIMPLE_DESC_TYPE_VA(in_clust_num, out_clust_num, ep_name) simple_desc_## ep_name = \
      {                                                                                        \
        ep_id,                                                                                 \
        ZB_AF_HA_PROFILE_ID,                                                                   \
        ZB_HA_CONSUMPTION_AWARENESS_DEVICE_ID,                                                 \
        ZB_DEVICE_VER,                                                                         \
        0,                                                                                     \
        in_clust_num,                                                                          \
        out_clust_num,                                                                         \
        {                                                                                      \
          ZB_ZCL_CLUSTER_ID_BASIC,                                                             \
          ZB_ZCL_CLUSTER_ID_IDENTIFY,                                                          \
          ZB_ZCL_CLUSTER_ID_ANALOG_INPUT,                                                      \
          ZB_ZCL_CLUSTER_ID_MULTI_VALUE,                                                       \
        }                                                                                      \
      }           
    
    /** @brief Declares endpoint for the COUNTER EndPoint.
     *   
     *  @param ep_name          Endpoint variable name.
     *  @param ep_id            Endpoint ID.
     *  @param cluster_list     Endpoint cluster list.
     */
    #define ZB_DECLARE_COUNTER_EP(ep_name, ep_id, cluster_list)                           \
      ZB_DECLARE_COUNTER_DESC(ep_name,                                                    \
                              ep_id,                                                      \
                              ZB_COUNTER_EP_IN_CLUSTER_NUM,                               \
                              ZB_COUNTER_EP_OUT_CLUSTER_NUM);                             \
                                                                                          \
      ZBOSS_DEVICE_DECLARE_REPORTING_CTX(reporting_info_counter,                          \
                                         (ZB_COUNTER_EP_REPORT_ATTR_COUNT));              \
                                                                                          \
      ZB_AF_DECLARE_ENDPOINT_DESC(ep_name,                                                \
                                  ep_id,                                                  \
                                  ZB_AF_HA_PROFILE_ID,                                    \
                                  0,                                                      \
                                  NULL,                                                   \
                                  ZB_ZCL_ARRAY_SIZE(cluster_list, zb_zcl_cluster_desc_t), \
                                  cluster_list,                                           \
                                  (zb_af_simple_desc_1_1_t*)&simple_desc_## ep_name,      \
                                  ZB_COUNTER_EP_REPORT_ATTR_COUNT,                        \
                                  reporting_info_counter,                                 \
                                  0,                                                      \
                                  NULL)
    
    
    /* -------------------------------------------- DUTY ENDPOINT DECLARE ---------------------------------------------------------- */
    
    /** @brief Declares cluster list for the DUTY EndPoint.
     *
     *  @param cluster_list_name            Cluster list variable name.
     *  @param basic_attr_list              Attribute list for the Basic cluster.
     *  @param identify_attr_list           Attribute list for the Identify cluster.
     *  @param time_live_in_hour_attr_list  Attribute list for the Multistate Input cluster.
     */
    #define ZB_DECLARE_DUTY_CLUSTER_LIST(                                     \
          cluster_list_name,                                                  \
          basic_attr_list,                                                    \
          identify_attr_list,                                                 \
          time_live_in_hour_attr_list)                                        \
          zb_zcl_cluster_desc_t cluster_list_name[] =                         \
          {                                                                   \
            ZB_ZCL_CLUSTER_DESC(                                              \
              ZB_ZCL_CLUSTER_ID_BASIC,                                        \
              ZB_ZCL_ARRAY_SIZE(basic_attr_list, zb_zcl_attr_t),              \
              (basic_attr_list),                                              \
              ZB_ZCL_CLUSTER_SERVER_ROLE,                                     \
              ZB_ZCL_MANUF_CODE_INVALID                                       \
            ),                                                                \
            ZB_ZCL_CLUSTER_DESC(                                              \
              ZB_ZCL_CLUSTER_ID_IDENTIFY,                                     \
              ZB_ZCL_ARRAY_SIZE(identify_attr_list, zb_zcl_attr_t),           \
              (identify_attr_list),                                           \
              ZB_ZCL_CLUSTER_SERVER_ROLE,                                     \
              ZB_ZCL_MANUF_CODE_INVALID                                       \
            ),                                                                \
            ZB_ZCL_CLUSTER_DESC(                                              \
              ZB_ZCL_CLUSTER_ID_MULTI_INPUT,                                  \
              ZB_ZCL_ARRAY_SIZE(time_live_in_hour_attr_list, zb_zcl_attr_t),  \
              (time_live_in_hour_attr_list),                                  \
              ZB_ZCL_CLUSTER_SERVER_ROLE,                                     \
              ZB_ZCL_MANUF_CODE_INVALID                                       \
            )                                                                 \
          }
    
    /** @brief Declares simple descriptor for the DUTY EndPoint.
     *  
     *  @param ep_name          Endpoint variable name.
     *  @param ep_id            Endpoint ID.
     *  @param in_clust_num     Number of the supported input clusters.
     *  @param out_clust_num    Number of the supported output clusters.
     */
    #define ZB_DECLARE_DUTY_DESC(ep_name, ep_id, in_clust_num, out_clust_num)                  \
      ZB_DECLARE_SIMPLE_DESC_VA(in_clust_num, out_clust_num, ep_name);                         \
      ZB_AF_SIMPLE_DESC_TYPE_VA(in_clust_num, out_clust_num, ep_name) simple_desc_## ep_name = \
      {                                                                                        \
        ep_id,                                                                                 \
        ZB_AF_HA_PROFILE_ID,                                                                   \
        ZB_HA_CONFIGURATION_TOOL_DEVICE_ID,                                                    \
        ZB_DEVICE_VER,                                                                         \
        0,                                                                                     \
        in_clust_num,                                                                          \
        out_clust_num,                                                                         \
        {                                                                                      \
          ZB_ZCL_CLUSTER_ID_BASIC,                                                             \
          ZB_ZCL_CLUSTER_ID_IDENTIFY,                                                          \
          ZB_ZCL_CLUSTER_ID_MULTI_INPUT,                                                       \
        }                                                                                      \
      }    
    
    /** @brief Declares endpoint for the DUTY EndPoint.
     *   
     *  @param ep_name          Endpoint variable name.
     *  @param ep_id            Endpoint ID.
     *  @param cluster_list     Endpoint cluster list.
     */
    #define ZB_DECLARE_DUTY_EP(ep_name, ep_id, cluster_list)                              \
      ZB_DECLARE_DUTY_DESC(ep_name,                                                       \
                           ep_id,                                                         \
                           ZB_DUTY_EP_IN_CLUSTER_NUM,                                     \
                           ZB_DUTY_EP_OUT_CLUSTER_NUM);                                   \
                                                                                          \
      ZBOSS_DEVICE_DECLARE_REPORTING_CTX(reporting_info_duty,                        \
                                         (ZB_DUTY_EP_REPORT_ATTR_COUNT));                 \
                                                                                          \
      ZB_AF_DECLARE_ENDPOINT_DESC(ep_name,                                                \
                                  ep_id,                                                  \
                                  ZB_AF_HA_PROFILE_ID,                                    \
                                  0,                                                      \
                                  NULL,                                                   \
                                  ZB_ZCL_ARRAY_SIZE(cluster_list, zb_zcl_cluster_desc_t), \
                                  cluster_list,                                           \
                                  (zb_af_simple_desc_1_1_t*)&simple_desc_## ep_name,      \
                                  ZB_DUTY_EP_REPORT_ATTR_COUNT,                           \
                                  reporting_info_duty,                               \
                                  0,                                                      \
                                  NULL)                                                   \
                                  
    
    /* -------------------------------------------- LEDS ENDPOINT DECLARE ---------------------------------------------------------- */
    
    /*!
      @brief Declare cluster list for Dimmable Light device
      @param cluster_list_name - cluster list variable name
      @param basic_attr_list - attribute list for Basic cluster
      @param identify_attr_list - attribute list for Identify cluster
      @param on_off_attr_list - attribute list for On/Off cluster
      @param level_control_attr_list - attribute list for Level Control cluster
     */
    #define ZB_DECLARE_LEDS_CLUSTER_LIST(                            \
      cluster_list_name,                                             \
      basic_attr_list,                                               \
      identify_attr_list,                                            \
      on_off_attr_list,                                              \
      level_control_attr_list,                                       \
      inversion_attr_list)                                           \
      zb_zcl_cluster_desc_t cluster_list_name[] =                    \
      {                                                              \
        ZB_ZCL_CLUSTER_DESC(                                         \
          ZB_ZCL_CLUSTER_ID_BASIC,                                   \
          ZB_ZCL_ARRAY_SIZE(basic_attr_list, zb_zcl_attr_t),         \
          (basic_attr_list),                                         \
          ZB_ZCL_CLUSTER_SERVER_ROLE,                                \
          ZB_ZCL_MANUF_CODE_INVALID                                  \
        ),                                                           \
        ZB_ZCL_CLUSTER_DESC(                                         \
          ZB_ZCL_CLUSTER_ID_IDENTIFY,                                \
          ZB_ZCL_ARRAY_SIZE(identify_attr_list, zb_zcl_attr_t),      \
          (identify_attr_list),                                      \
          ZB_ZCL_CLUSTER_SERVER_ROLE,                                \
          ZB_ZCL_MANUF_CODE_INVALID                                  \
        ),                                                           \
        ZB_ZCL_CLUSTER_DESC(                                         \
          ZB_ZCL_CLUSTER_ID_ON_OFF,                                  \
          ZB_ZCL_ARRAY_SIZE(on_off_attr_list, zb_zcl_attr_t),        \
          (on_off_attr_list),                                        \
          ZB_ZCL_CLUSTER_SERVER_ROLE,                                \
          ZB_ZCL_MANUF_CODE_INVALID                                  \
        ),                                                           \
        ZB_ZCL_CLUSTER_DESC(                                         \
          ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL,                           \
          ZB_ZCL_ARRAY_SIZE(level_control_attr_list, zb_zcl_attr_t), \
          (level_control_attr_list),                                 \
          ZB_ZCL_CLUSTER_SERVER_ROLE,                                \
          ZB_ZCL_MANUF_CODE_INVALID                                  \
        ),                                                           \
        ZB_ZCL_CLUSTER_DESC(                                         \
          ZB_ZCL_CLUSTER_ID_BINARY_VALUE,                            \
          ZB_ZCL_ARRAY_SIZE(inversion_attr_list, zb_zcl_attr_t),     \
          (inversion_attr_list),                                     \
          ZB_ZCL_CLUSTER_SERVER_ROLE,                                \
          ZB_ZCL_MANUF_CODE_INVALID                                  \
        )                                                            \
      }
    
    
    /*!
      @brief Declare simple descriptor for Dimmable Light device
      @param ep_name - endpoint variable name
      @param ep_id - endpoint ID
      @param in_clust_num - number of supported input clusters
      @param out_clust_num - number of supported output clusters
    */
    #define ZB_DECLARE_LEDS_SIMPLE_DESC(ep_name, ep_id, in_clust_num, out_clust_num)           \
      ZB_DECLARE_SIMPLE_DESC_VA(in_clust_num, out_clust_num, ep_name);                         \
      ZB_AF_SIMPLE_DESC_TYPE_VA(in_clust_num, out_clust_num, ep_name) simple_desc_## ep_name = \
      {                                                                                        \
        ep_id,                                                                                 \
        ZB_AF_HA_PROFILE_ID,                                                                   \
        ZB_HA_DIMMABLE_LIGHT_DEVICE_ID,                                                        \
        ZB_DEVICE_VER,                                                                         \
        0,                                                                                     \
        in_clust_num,                                                                          \
        out_clust_num,                                                                         \
        {                                                                                      \
          ZB_ZCL_CLUSTER_ID_BASIC,                                                             \
          ZB_ZCL_CLUSTER_ID_IDENTIFY,                                                          \
          ZB_ZCL_CLUSTER_ID_ON_OFF,                                                            \
          ZB_ZCL_CLUSTER_ID_LEVEL_CONTROL,                                                     \
          ZB_ZCL_CLUSTER_ID_BINARY_VALUE                                                       \
        }                                                                                      \
      }   
    
    /*!
      @brief Declare endpoint for Dimmable Light device
      @param ep_name - endpoint variable name
      @param ep_id - endpoint ID
      @param cluster_list - endpoint cluster list
     */
    #define ZB_DECLARE_LEDS_EP(ep_name, ep_id, cluster_list)                              \
      ZB_DECLARE_LEDS_SIMPLE_DESC(ep_name,                                                \
                                  ep_id,                                                  \
                                  ZB_LEDS_EP_IN_CLUSTER_NUM,                              \
                                  ZB_LEDS_EP_OUT_CLUSTER_NUM);                            \
                                                                                          \
      ZBOSS_DEVICE_DECLARE_REPORTING_CTX(reporting_info_leds,                             \
                                         (ZB_LEDS_EP_REPORT_ATTR_COUNT));                 \
                                                                                          \
      ZBOSS_DEVICE_DECLARE_LEVEL_CONTROL_CTX(cvc_alarm_info## ep_name,                    \
                                             ZB_LEDS_EP_LIGHT_CVC_ATTR_COUNT);            \
                                                                                          \
      ZB_AF_DECLARE_ENDPOINT_DESC(ep_name,                                                \
                                  ep_id,                                                  \
                                  ZB_AF_HA_PROFILE_ID,                                    \
                                  0,                                                      \
                                  NULL,                                                   \
                                  ZB_ZCL_ARRAY_SIZE(cluster_list, zb_zcl_cluster_desc_t), \
                                  cluster_list,                                           \
                                  (zb_af_simple_desc_1_1_t*)&simple_desc_## ep_name,      \
                                  ZB_LEDS_EP_REPORT_ATTR_COUNT,                           \
                                  reporting_info_leds,                                    \
                                  ZB_LEDS_EP_LIGHT_CVC_ATTR_COUNT,                        \
                                  cvc_alarm_info## ep_name)
    
    #endif // ZB_COUNTING_H_
    

    main.c:

    ZB_ZCL_DECLARE_IDENTIFY_ATTRIB_LIST(identify_attr_list_counter, &m_dev_ctx.identify_attr_counter.identify_time);
    ZB_ZCL_DECLARE_IDENTIFY_ATTRIB_LIST(identify_attr_list_duty,    &m_dev_ctx.identify_attr_duty.identify_time);
    ZB_ZCL_DECLARE_IDENTIFY_ATTRIB_LIST(identify_attr_list_leds,    &m_dev_ctx.identify_attr_leds.identify_time);
    
    ZB_ZCL_DECLARE_BASIC_ATTRIB_LIST_EXT(basic_attr_list_counter,
                                         &m_dev_ctx.basic_attr_counter.zcl_version,
                                         &m_dev_ctx.basic_attr_counter.app_version,
                                         &m_dev_ctx.basic_attr_counter.stack_version,
                                         &m_dev_ctx.basic_attr_counter.hw_version,
                                         m_dev_ctx.basic_attr_counter.mf_name,
                                         m_dev_ctx.basic_attr_counter.model_id,
                                         m_dev_ctx.basic_attr_counter.date_code,
                                         &m_dev_ctx.basic_attr_counter.power_source,
                                         m_dev_ctx.basic_attr_counter.location_id,
                                         &m_dev_ctx.basic_attr_counter.ph_env,
                                         m_dev_ctx.basic_attr_counter.sw_ver);
    ZB_ZCL_DECLARE_BASIC_ATTRIB_LIST_EXT(basic_attr_list_duty,
                                         &m_dev_ctx.basic_attr_duty.zcl_version,
                                         &m_dev_ctx.basic_attr_duty.app_version,
                                         &m_dev_ctx.basic_attr_duty.stack_version,
                                         &m_dev_ctx.basic_attr_duty.hw_version,
                                         m_dev_ctx.basic_attr_duty.mf_name,
                                         m_dev_ctx.basic_attr_duty.model_id,
                                         m_dev_ctx.basic_attr_duty.date_code,
                                         &m_dev_ctx.basic_attr_duty.power_source,
                                         m_dev_ctx.basic_attr_duty.location_id,
                                         &m_dev_ctx.basic_attr_duty.ph_env,
                                         m_dev_ctx.basic_attr_duty.sw_ver);
    ZB_ZCL_DECLARE_BASIC_ATTRIB_LIST_EXT(basic_attr_list_leds,
                                         &m_dev_ctx.basic_attr_leds.zcl_version,
                                         &m_dev_ctx.basic_attr_leds.app_version,
                                         &m_dev_ctx.basic_attr_leds.stack_version,
                                         &m_dev_ctx.basic_attr_leds.hw_version,
                                         m_dev_ctx.basic_attr_leds.mf_name,
                                         m_dev_ctx.basic_attr_leds.model_id,
                                         m_dev_ctx.basic_attr_leds.date_code,
                                         &m_dev_ctx.basic_attr_leds.power_source,
                                         m_dev_ctx.basic_attr_leds.location_id,
                                         &m_dev_ctx.basic_attr_leds.ph_env,
                                         m_dev_ctx.basic_attr_leds.sw_ver);
    
    /* COUNTER clusters */
    ZB_ZCL_DECLARE_ANALOG_INPUT_ATTRIB_LIST(counter_attr_list,
                                            &m_dev_ctx.counter_value.out_of_service,
                                            &m_dev_ctx.counter_value.present_value,
                                            &m_dev_ctx.counter_value.status_flags);
    
    ZB_ZCL_DECLARE_MULTI_VALUE_ATTRIB_LIST(pulse_in_kwh_attr_list,
                                           &m_dev_ctx.counter_pulse_in_kwh.number_of_states,
                                           &m_dev_ctx.counter_pulse_in_kwh.out_of_service,
                                           &m_dev_ctx.counter_pulse_in_kwh.present_value,
                                           &m_dev_ctx.counter_pulse_in_kwh.status_flags);
    
    /* DUTYT clusters */
    ZB_ZCL_DECLARE_MULTI_INPUT_ATTRIB_LIST(time_live_in_hour_attr_list,
                                           &m_dev_ctx.duty_time_live_in_hour.number_of_states,
                                           &m_dev_ctx.duty_time_live_in_hour.out_of_service,
                                           &m_dev_ctx.duty_time_live_in_hour.present_value,
                                           &m_dev_ctx.duty_time_live_in_hour.status_flags);
    
    /* LEDS clusters */
    ZB_ZCL_DECLARE_ON_OFF_ATTRIB_LIST_EXT(on_off_attr_list,
                                          &m_dev_ctx.leds_on_off.on_off,
                                          &m_dev_ctx.leds_on_off.global_scene_ctrl,
                                          &m_dev_ctx.leds_on_off.on_time,
                                          &m_dev_ctx.leds_on_off.off_wait_time);
    
    ZB_ZCL_DECLARE_LEVEL_CONTROL_ATTRIB_LIST(level_control_attr_list,
                                             &m_dev_ctx.leds_level_control.current_level,
                                             &m_dev_ctx.leds_level_control.remaining_time);
    
    ZB_ZCL_DECLARE_BINARY_VALUE_ATTRIB_LIST(led_inversion_attr_list,
                                            &m_dev_ctx.leds_inversion.out_of_service,
                                            &m_dev_ctx.leds_inversion.present_value,
                                            &m_dev_ctx.leds_inversion.status_flags); 
    
    /* EP1 - COUNTER */
    ZB_DECLARE_COUNTER_CLUSTER_LIST(counter_cluster_list, basic_attr_list_counter, identify_attr_list_counter, counter_attr_list, pulse_in_kwh_attr_list);
    ZB_DECLARE_COUNTER_EP(counter_ep, ZB_COUNTER_EP, counter_cluster_list); 
    
    /* EP2 - DUTY */
    ZB_DECLARE_DUTY_CLUSTER_LIST(duty_cluster_list, basic_attr_list_duty, identify_attr_list_duty, time_live_in_hour_attr_list);
    ZB_DECLARE_DUTY_EP(duty_ep, ZB_DUTY_EP, duty_cluster_list);
    
    /* EP3 - LEDS */
    ZB_DECLARE_LEDS_CLUSTER_LIST(leds_cluster_list, basic_attr_list_leds, identify_attr_list_leds, on_off_attr_list, level_control_attr_list, led_inversion_attr_list);
    ZB_DECLARE_LEDS_EP(leds_ep, ZB_LEDS_EP, leds_cluster_list);
    
    /* CTX */
    ZBOSS_DECLARE_DEVICE_CTX_3_EP(device_ctx, counter_ep, duty_ep, leds_ep);

    My code, where the array for reporting is common to all endpoints (as I wrote earlier) works fine, but does not work with new edits (as in the example). I can’t understand what’s the matter. Please help me, it has dragged on for too long. I want to make a cleaner decision.

    Thanks in advance.

Related