diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 50fd845..1139f3a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,28 @@ # Espressif Zigbee SDK Release Notes +## 04-Jul-2024 +1.4.0 version release of ESP-ZIGBEE-SDK is based on esp-idf v5.1.3 + +### Features +- Updated esp-zboss-lib to v1.4.0 +- Updated esp-zigbee-lib to v1.4.0 +- Supported more flexible ZCL data model APIs +- Supported sending ZCL commands without client cluster +- Supported receiving ZCL commands without server cluster for gateway endpoint +- Supported ZDO energy detection +- Supported ZDO scanning of closed networks +- Supported ZCL IAS WD cluster +- Optimized ZCL window covering and controller device type support +- Added ZCL window covering cluster message callback + +### Bug Fixes +- Fixed issues with attribute reporting and reading when fragmentation is required + +### Note +- Reusing the ZCL Zigbee data model entries is no longer allowed, all attributes/clusters/endpoints have to be created separately +- Deprecated `esp_zb_cluster_list_update_xxx_cluster()` APIs + + ## 24-May-2024 1.3.2 version release of ESP-ZIGBEE-SDK is based on esp-idf v5.1.3 diff --git a/components/esp-zigbee-lib/idf_component.yml b/components/esp-zigbee-lib/idf_component.yml index 200246a..a01a30b 100644 --- a/components/esp-zigbee-lib/idf_component.yml +++ b/components/esp-zigbee-lib/idf_component.yml @@ -1,4 +1,4 @@ -version: "1.3.2" +version: "1.4.0" description: esp-zigbee library component url: https://github.com/espressif/esp-zigbee-sdk dependencies: diff --git a/components/esp-zigbee-lib/include/esp_zigbee_attribute.h b/components/esp-zigbee-lib/include/esp_zigbee_attribute.h index 4ffaeaa..f69cc64 100644 --- a/components/esp-zigbee-lib/include/esp_zigbee_attribute.h +++ b/components/esp-zigbee-lib/include/esp_zigbee_attribute.h @@ -334,6 +334,20 @@ esp_err_t esp_zb_ias_ace_get_zone_table_length(uint8_t endpoint, uint8_t *table_ */ esp_err_t esp_zb_ias_ace_get_zone_table(uint8_t endpoint, esp_zb_zcl_ias_ace_zone_table_t** table_p); +/** + * @brief Add an attribute in IAS_WD cluster. + * + * @param[in] attr_list A pointer to attribute list @ref esp_zb_attribute_list_s + * @param[in] attr_id An attribute id to be added + * @param[in] value_p A pointer to attribute value wants to add + * + * @return + * - ESP_OK on success + * - ESP_ERR_INVALID_ARG if attribute is existed or unsupported + * + */ +esp_err_t esp_zb_ias_wd_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p); + /** * @brief Add an attribute in temperature measurement cluster. * diff --git a/components/esp-zigbee-lib/include/esp_zigbee_cluster.h b/components/esp-zigbee-lib/include/esp_zigbee_cluster.h index decdf21..fb66a11 100644 --- a/components/esp-zigbee-lib/include/esp_zigbee_cluster.h +++ b/components/esp-zigbee-lib/include/esp_zigbee_cluster.h @@ -214,6 +214,17 @@ esp_zb_attribute_list_t *esp_zb_ias_zone_cluster_create(esp_zb_ias_zone_cluster_ */ esp_zb_attribute_list_t *esp_zb_ias_ace_cluster_create(uint8_t zone_table_size); +/** + * @brief Create a standard IAS WD cluster attribute list. + * + * @note This only contains the mandatory attribute. + * @param[in] ias_wd_cfg Configuration parameters for this cluster defined by @ref esp_zb_ias_wd_cluster_cfg_s + * + * @return Pointer to attribute list @ref esp_zb_attribute_list_s + * + */ +esp_zb_attribute_list_t *esp_zb_ias_wd_cluster_create(esp_zb_ias_wd_cluster_cfg_t *ias_wd_cfg); + /** * @brief Create a standard temperature measurement cluster attribute list. * @@ -654,6 +665,20 @@ esp_err_t esp_zb_cluster_list_add_ias_zone_cluster(esp_zb_cluster_list_t *cluste */ esp_err_t esp_zb_cluster_list_add_ias_ace_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); +/** + * @brief Add IAS_WD cluster (attribute list) in a cluster list. + * + * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s + * @param[in] attr_list An attribute list which wants to add + * @param[in] role_mask A role of server or client for this cluster (attribute list) refer to esp_zb_zcl_cluster_role_t + * + * @return + * - ESP_OK on success + * - ESP_ERR_INVALID_ARG if cluster list not initialized + * + */ +esp_err_t esp_zb_cluster_list_add_ias_wd_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); + /** * @brief Add Door Lock cluster (attribute list) in a cluster list. * @@ -1009,9 +1034,41 @@ esp_err_t esp_zb_cluster_list_add_price_cluster(esp_zb_cluster_list_t *cluster_l */ esp_err_t esp_zb_cluster_list_add_custom_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); +/** + * @brief Get cluster (attribute list) from a cluster list. + * + * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s + * @param[in] cluster_id The cluster id for attribute list refer to esp_zb_zcl_cluster_id + * @param[in] role_mask A role of server or client for this cluster (attribute list) refer to esp_zb_zcl_cluster_role_t + * + * @return + * - pointer to @ref esp_zb_attribute_list_s, if the cluster is found in the cluster list + * - ``NULL`` if cluster is not found + * + */ +esp_zb_attribute_list_t *esp_zb_cluster_list_get_cluster(const esp_zb_cluster_list_t *cluster_list, uint16_t cluster_id, uint8_t role_mask); + /**************************************** UPDATE CLUSTER ***********************************/ + +/** + * @brief Update cluster (attribute list) in a cluster list. + * + * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s + * @param[in] attr_list An attribute list which wants to update + * @param[in] cluster_id The cluster id for attribute list refer to esp_zb_zcl_cluster_id + * @param[in] role_mask A role of server or client for this cluster (attribute list) refer to esp_zb_zcl_cluster_role_t + * + * @return + * - ESP_OK on success + * - ESP_ERR_INVALID_ARG if cluster list not initialized + * + */ +esp_err_t esp_zb_cluster_list_update_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, + uint16_t cluster_id, uint8_t role_mask); + /** * @brief Update basic cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1022,10 +1079,12 @@ esp_err_t esp_zb_cluster_list_add_custom_cluster(esp_zb_cluster_list_t *cluster_ * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_basic_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update power configuration cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1036,10 +1095,12 @@ esp_err_t esp_zb_cluster_list_update_basic_cluster(esp_zb_cluster_list_t *cluste * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_power_config_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update identify cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1050,10 +1111,12 @@ esp_err_t esp_zb_cluster_list_update_power_config_cluster(esp_zb_cluster_list_t * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_identify_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update groups cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1064,10 +1127,12 @@ esp_err_t esp_zb_cluster_list_update_identify_cluster(esp_zb_cluster_list_t *clu * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_groups_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update scenes cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1078,10 +1143,12 @@ esp_err_t esp_zb_cluster_list_update_groups_cluster(esp_zb_cluster_list_t *clust * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_scenes_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update on_off cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1092,10 +1159,12 @@ esp_err_t esp_zb_cluster_list_update_scenes_cluster(esp_zb_cluster_list_t *clust * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_on_off_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update on_off switch config cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1106,10 +1175,12 @@ esp_err_t esp_zb_cluster_list_update_on_off_cluster(esp_zb_cluster_list_t *clust * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_on_off_switch_config_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update level cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1120,10 +1191,12 @@ esp_err_t esp_zb_cluster_list_update_on_off_switch_config_cluster(esp_zb_cluster * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_level_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update color control cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1134,10 +1207,12 @@ esp_err_t esp_zb_cluster_list_update_level_cluster(esp_zb_cluster_list_t *cluste * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_color_control_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update Time cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1148,10 +1223,12 @@ esp_err_t esp_zb_cluster_list_update_color_control_cluster(esp_zb_cluster_list_t * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_time_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update Shade Config cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1162,10 +1239,12 @@ esp_err_t esp_zb_cluster_list_update_time_cluster(esp_zb_cluster_list_t *cluster * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_shade_config_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update binary input (basic) cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to add @@ -1176,10 +1255,12 @@ esp_err_t esp_zb_cluster_list_update_shade_config_cluster(esp_zb_cluster_list_t * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_binary_input_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update Commissioning cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1190,10 +1271,12 @@ esp_err_t esp_zb_cluster_list_update_binary_input_cluster(esp_zb_cluster_list_t * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_commissioning_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update ias zone cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to add @@ -1204,10 +1287,12 @@ esp_err_t esp_zb_cluster_list_update_commissioning_cluster(esp_zb_cluster_list_t * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_ias_zone_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update IAS ACE cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1218,10 +1303,28 @@ esp_err_t esp_zb_cluster_list_update_ias_zone_cluster(esp_zb_cluster_list_t *clu * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_ias_ace_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); +/** + * @brief Update IAS_WD cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. + * + * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s + * @param[in] attr_list An attribute list which wants to update + * @param[in] role_mask A role of server or client for this cluster (attribute list) refer to esp_zb_zcl_cluster_role_t + * + * @return + * - ESP_OK on success + * - ESP_ERR_INVALID_ARG if cluster list not initialized + * + */ +ESP_ZB_DEPRECATED +esp_err_t esp_zb_cluster_list_update_ias_wd_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); + /** * @brief Update Door Lock cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1232,10 +1335,12 @@ esp_err_t esp_zb_cluster_list_update_ias_ace_cluster(esp_zb_cluster_list_t *clus * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_door_lock_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update temperature measurement cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1246,10 +1351,12 @@ esp_err_t esp_zb_cluster_list_update_door_lock_cluster(esp_zb_cluster_list_t *cl * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_temperature_meas_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update humidity measurement cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1260,10 +1367,12 @@ esp_err_t esp_zb_cluster_list_update_temperature_meas_cluster(esp_zb_cluster_lis * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_humidity_meas_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update illuminance measurement cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1274,10 +1383,12 @@ esp_err_t esp_zb_cluster_list_update_humidity_meas_cluster(esp_zb_cluster_list_t * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_illuminance_meas_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update pressure measurement cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1288,10 +1399,12 @@ esp_err_t esp_zb_cluster_list_update_illuminance_meas_cluster(esp_zb_cluster_lis * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_pressure_meas_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update flow measurement cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1302,10 +1415,12 @@ esp_err_t esp_zb_cluster_list_update_pressure_meas_cluster(esp_zb_cluster_list_t * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_flow_meas_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update electrical measurement cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1316,10 +1431,12 @@ esp_err_t esp_zb_cluster_list_update_flow_meas_cluster(esp_zb_cluster_list_t *cl * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_electrical_meas_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update occupancy sensor cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1330,10 +1447,12 @@ esp_err_t esp_zb_cluster_list_update_electrical_meas_cluster(esp_zb_cluster_list * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_occupancy_sensing_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update window covering cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1344,10 +1463,12 @@ esp_err_t esp_zb_cluster_list_update_occupancy_sensing_cluster(esp_zb_cluster_li * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_window_covering_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update thermostat cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1358,10 +1479,12 @@ esp_err_t esp_zb_cluster_list_update_window_covering_cluster(esp_zb_cluster_list * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_thermostat_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update fan control cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1372,10 +1495,12 @@ esp_err_t esp_zb_cluster_list_update_thermostat_cluster(esp_zb_cluster_list_t *c * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_fan_control_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update thermostat ui config cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1386,10 +1511,12 @@ esp_err_t esp_zb_cluster_list_update_fan_control_cluster(esp_zb_cluster_list_t * * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_thermostat_ui_config_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update analog input cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1400,10 +1527,12 @@ esp_err_t esp_zb_cluster_list_update_thermostat_ui_config_cluster(esp_zb_cluster * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_analog_input_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update analog output cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1414,10 +1543,12 @@ esp_err_t esp_zb_cluster_list_update_analog_input_cluster(esp_zb_cluster_list_t * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_analog_output_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update analog value cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1428,10 +1559,12 @@ esp_err_t esp_zb_cluster_list_update_analog_output_cluster(esp_zb_cluster_list_t * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_analog_value_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update carbon dioxide measurement cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1442,10 +1575,12 @@ esp_err_t esp_zb_cluster_list_update_analog_value_cluster(esp_zb_cluster_list_t * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_carbon_dioxide_measurement_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update pm2.5 measurement cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1456,10 +1591,12 @@ esp_err_t esp_zb_cluster_list_update_carbon_dioxide_measurement_cluster(esp_zb_c * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_pm2_5_measurement_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update multistate value cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1470,10 +1607,12 @@ esp_err_t esp_zb_cluster_list_update_pm2_5_measurement_cluster(esp_zb_cluster_li * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_multistate_value_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update metering cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1484,10 +1623,12 @@ esp_err_t esp_zb_cluster_list_update_multistate_value_cluster(esp_zb_cluster_lis * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_metering_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update diagnostics cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1498,10 +1639,12 @@ esp_err_t esp_zb_cluster_list_update_metering_cluster(esp_zb_cluster_list_t *clu * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_diagnostics_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update meter identification cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1512,10 +1655,12 @@ esp_err_t esp_zb_cluster_list_update_diagnostics_cluster(esp_zb_cluster_list_t * * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_meter_identification_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update price cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1526,10 +1671,12 @@ esp_err_t esp_zb_cluster_list_update_meter_identification_cluster(esp_zb_cluster * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_price_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update OTA cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1540,10 +1687,12 @@ esp_err_t esp_zb_cluster_list_update_price_cluster(esp_zb_cluster_list_t *cluste * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_ota_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); /** * @brief Update customized cluster (attribute list) in a cluster list. + * @deprecated This will be removed from the SDK, please use ``esp_zb_cluster_list_update_cluster()`` instead. * * @param[in] cluster_list A pointer to cluster list @ref esp_zb_cluster_list_s * @param[in] attr_list An attribute list which wants to update @@ -1554,6 +1703,7 @@ esp_err_t esp_zb_cluster_list_update_ota_cluster(esp_zb_cluster_list_t *cluster_ * - ESP_ERR_INVALID_ARG if cluster list not initialized * */ +ESP_ZB_DEPRECATED esp_err_t esp_zb_cluster_list_update_custom_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask); #ifdef __cplusplus diff --git a/components/esp-zigbee-lib/include/esp_zigbee_core.h b/components/esp-zigbee-lib/include/esp_zigbee_core.h index 063afb4..0d0e0be 100644 --- a/components/esp-zigbee-lib/include/esp_zigbee_core.h +++ b/components/esp-zigbee-lib/include/esp_zigbee_core.h @@ -60,8 +60,25 @@ typedef enum { /** * @brief Enum of the Zigbee core action callback id * - * @note If one endpoint possesses the same custom cluster identifier in both client and server roles, - * any request or response command for the custom cluster will only trigger the ESP_ZB_CORE_CMD_CUSTOM_CLUSTER_REQ_CB_ID callback. + * @note + * 1. If one endpoint possesses the same custom cluster identifier in both client and server roles, + * any request or response command for the custom cluster will only trigger the + * ``ESP_ZB_CORE_CMD_CUSTOM_CLUSTER_REQ_CB_ID`` callback. + * 2. The callback ids without ``CMD`` in their names would provide messages of the following structure: + * @code{c} + * typedef struct xxx_message_s { + * esp_zb_device_cb_common_info_t info; + * ... + * } xxx_message_t; + * @endcode + * While the callback ids with ``CMD`` in their names would provide messages of the following structure: + * @code{c} + * typedef struct xxx_message_s { + * esp_zb_zcl_cmd_info_t info; + * ... + * } xxx_message_t; + * @endcode + * */ typedef enum esp_zb_core_action_callback_id_s { ESP_ZB_CORE_SET_ATTR_VALUE_CB_ID = 0x0000, /*!< Set attribute value, refer to esp_zb_zcl_set_attr_value_message_t */ @@ -93,6 +110,26 @@ typedef enum esp_zb_core_action_callback_id_s { ESP_ZB_CORE_COMM_RESTART_DEVICE_CB_ID = 0x001a, /*!< Commissioning restart device, refer to esp_zigbee_zcl_commissioning_restart_device_message_t */ ESP_ZB_CORE_COMM_OPERATE_STARTUP_PARAMS_CB_ID = 0x001b, /*!< Commissioning operate startup parameters, refer to esp_zigbee_zcl_commissioning_operate_startup_parameters_message_t */ ESP_ZB_CORE_COMM_COMMAND_RESP_CB_ID = 0x001c, /*!< Commissioning command response, refer to esp_zigbee_zcl_commissioning_command_response_message_t */ + ESP_ZB_CORE_IAS_WD_START_WARNING_CB_ID = 0x001d, /*!< IAS WD cluster Start Warning command, refer to esp_zb_zcl_ias_wd_start_warning_message_t */ + ESP_ZB_CORE_IAS_WD_SQUAWK_CB_ID = 0x001e, /*!< IAS WD cluster Squawk command, refer to esp_zb_zcl_ias_wd_squawk_message_t */ + ESP_ZB_CORE_IAS_ACE_ARM_CB_ID = 0x001f, /*!< IAS ACE cluster Arm command, refer to esp_zb_zcl_ias_ace_arm_message_t */ + ESP_ZB_CORE_IAS_ACE_BYPASS_CB_ID = 0x0020, /*!< IAS ACE cluster Bypass command, refer to esp_zb_zcl_ias_ace_bypass_message_t */ + ESP_ZB_CORE_IAS_ACE_EMERGENCY_CB_ID = 0x0021, /*!< IAS ACE cluster Emergency command, refer to esp_zb_zcl_ias_ace_emergency_message_t */ + ESP_ZB_CORE_IAS_ACE_FIRE_CB_ID = 0x0022, /*!< IAS ACE cluster Fire command, refer to esp_zb_zcl_ias_ace_fire_message_t */ + ESP_ZB_CORE_IAS_ACE_PANIC_CB_ID = 0x0023, /*!< IAS ACE cluster Panic command, refer to esp_zb_zcl_ias_ace_panic_message_t */ + ESP_ZB_CORE_IAS_ACE_GET_PANEL_STATUS_CB_ID = 0x0024, /*!< IAS ACE cluster Get Panel Status command, refer to esp_zb_zcl_ias_ace_get_panel_status_message_t */ + ESP_ZB_CORE_IAS_ACE_GET_BYPASSED_ZONE_LIST_CB_ID = 0x0025, /*!< IAS ACE cluster Get Bypass Zone List command, refer to esp_zb_zcl_ias_ace_get_bypassed_zone_list_message_t */ + ESP_ZB_CORE_IAS_ACE_GET_ZONE_STATUS_CB_ID = 0x0026, /*!< IAS ACE cluster Get Zone Status command, refer to esp_zb_zcl_ias_ace_get_zone_status_message_t */ + ESP_ZB_CORE_IAS_ACE_ARM_RESP_CB_ID = 0x0027, /*!< IAS ACE cluster Arm command response, refer to esp_zb_zcl_ias_ace_arm_response_message_t */ + ESP_ZB_CORE_IAS_ACE_GET_ZONE_ID_MAP_RESP_CB_ID = 0x0028, /*!< IAS ACE cluster Get Zone ID MAP command response, refer to esp_zb_zcl_ias_ace_get_zone_id_map_response_message_t */ + ESP_ZB_CORE_IAS_ACE_GET_ZONE_INFO_RESP_CB_ID = 0x0029, /*!< IAS ACE cluster Get Zone Information command response, refer to esp_zb_zcl_ias_ace_get_zone_info_response_message_t */ + ESP_ZB_CORE_IAS_ACE_ZONE_STATUS_CHANGED_CB_ID = 0x002a, /*!< IAS ACE cluster Zone Status Changed command, refer to esp_zb_zcl_ias_ace_zone_status_changed_message_t */ + ESP_ZB_CORE_IAS_ACE_PANEL_STATUS_CHANGED_CB_ID = 0x002b, /*!< IAS ACE cluster Panel Status Changed command, refer to esp_zb_zcl_ias_ace_panel_status_changed_message_t */ + ESP_ZB_CORE_IAS_ACE_GET_PANEL_STATUS_RESP_CB_ID = 0x002c, /*!< IAS ACE cluster Get Panel Status command response, refer to esp_zb_zcl_ias_ace_get_panel_status_response_message_t */ + ESP_ZB_CORE_IAS_ACE_SET_BYPASSED_ZONE_LIST_CB_ID = 0x002d, /*!< IAS ACE cluster Set Bypassed Zone List command, refer to esp_zb_zcl_ias_ace_set_bypassed_zone_list_message_t */ + ESP_ZB_CORE_IAS_ACE_BYPASS_RESP_CB_ID = 0x002e, /*!< IAS ACE cluster Bypass command response, refer to esp_zb_zcl_ias_ace_bypass_response_message_t */ + ESP_ZB_CORE_IAS_ACE_GET_ZONE_STATUS_RESP_CB_ID = 0x002f, /*!< IAS ACE cluster Get Zone Status command response, refer to esp_zb_zcl_ias_ace_get_zone_status_response_message_t */ + ESP_ZB_CORE_WINDOW_COVERING_MOVEMENT_CB_ID = 0x0030, /*!< Window covering movement command, refer to esp_zb_zcl_window_covering_movement_message_t */ ESP_ZB_CORE_CMD_READ_ATTR_RESP_CB_ID = 0x1000, /*!< Read attribute response, refer to esp_zb_zcl_cmd_read_attr_resp_message_t */ ESP_ZB_CORE_CMD_WRITE_ATTR_RESP_CB_ID = 0x1001, /*!< Write attribute response, refer to esp_zb_zcl_cmd_write_attr_resp_message_t */ ESP_ZB_CORE_CMD_REPORT_CONFIG_RESP_CB_ID = 0x1002, /*!< Configure report response, refer to esp_zb_zcl_cmd_config_report_resp_message_t */ @@ -113,23 +150,6 @@ typedef enum esp_zb_core_action_callback_id_s { ESP_ZB_CORE_CMD_PRIVILEGE_COMMAND_RESP_CB_ID = 0x1051, /*!< Custom Cluster response, refer to esp_zb_zcl_privilege_command_message_t */ ESP_ZB_CORE_CMD_TOUCHLINK_GET_GROUP_ID_RESP_CB_ID = 0x1060, /*!< Touchlink commissioning cluster get group id response, refer to esp_zb_touchlink_get_group_identifiers_resp_message_t */ ESP_ZB_CORE_CMD_TOUCHLINK_GET_ENDPOINT_LIST_RESP_CB_ID = 0x1061, /*!< Touchlink commissioning cluster get endpoint list response, refer to esp_zb_zcl_touchlink_get_endpoint_list_resp_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_ARM_CB_ID = 0x0168, /*!< IAS ACE cluster Arm command, refer to esp_zb_zcl_ias_ace_arm_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_BYPASS_CB_ID = 0x0169, /*!< IAS ACE cluster Bypass command, refer to esp_zb_zcl_ias_ace_bypass_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_EMERGENCY_CB_ID = 0x016A, /*!< IAS ACE cluster Emergency command, refer to esp_zb_zcl_ias_ace_emergency_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_FIRE_CB_ID = 0x016B, /*!< IAS ACE cluster Fire command, refer to esp_zb_zcl_ias_ace_fire_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_PANIC_CB_ID = 0x016C, /*!< IAS ACE cluster Panic command, refer to esp_zb_zcl_ias_ace_panic_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_GET_PANEL_STATUS_CB_ID = 0x016D, /*!< IAS ACE cluster Get Panel Status command, refer to esp_zb_zcl_ias_ace_get_panel_status_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_GET_BYPASSED_ZONE_LIST_CB_ID = 0x016E, /*!< IAS ACE cluster Get Bypass Zone List command, refer to esp_zb_zcl_ias_ace_get_bypassed_zone_list_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_GET_ZONE_STATUS_CB_ID = 0x016F, /*!< IAS ACE cluster Get Zone Status command, refer to esp_zb_zcl_ias_ace_get_zone_status_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_ARM_RESP_CB_ID = 0x0170, /*!< IAS ACE cluster Arm command response, refer to esp_zb_zcl_ias_ace_arm_response_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_GET_ZONE_ID_MAP_RESP_CB_ID = 0x0171, /*!< IAS ACE cluster Get Zone ID MAP command response, refer to esp_zb_zcl_ias_ace_get_zone_id_map_response_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_GET_ZONE_INFO_RESP_CB_ID = 0x0172, /*!< IAS ACE cluster Get Zone Information command response, refer to esp_zb_zcl_ias_ace_get_zone_info_response_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_ZONE_STATUS_CHANGED_CB_ID = 0x0173, /*!< IAS ACE cluster Zone Status Changed command, refer to esp_zb_zcl_ias_ace_zone_status_changed_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_PANEL_STATUS_CHANGED_CB_ID = 0x0174, /*!< IAS ACE cluster Panel Status Changed command, refer to esp_zb_zcl_ias_ace_panel_status_changed_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_GET_PANEL_STATUS_RESP_CB_ID = 0x0175, /*!< IAS ACE cluster Get Panel Status command response, refer to esp_zb_zcl_ias_ace_get_panel_status_response_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_SET_BYPASSED_ZONE_LIST_CB_ID = 0x0176, /*!< IAS ACE cluster Set Bypassed Zone List command, refer to esp_zb_zcl_ias_ace_set_bypassed_zone_list_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_BYPASS_RESP_CB_ID = 0x0177, /*!< IAS ACE cluster Bypass command response, refer to esp_zb_zcl_ias_ace_bypass_response_message_t */ - ESP_ZB_CORE_CMD_IAS_ACE_GET_ZONE_STATUS_RESP_CB_ID = 0x0178, /*!< IAS ACE cluster Get Zone Status command response, refer to esp_zb_zcl_ias_ace_get_zone_status_response_message_t */ ESP_ZB_CORE_CMD_GREEN_POWER_RECV_CB_ID = 0x1F00, /*!< Green power cluster command receiving, refer to esp_zb_zcl_cmd_green_power_recv_message_t */ ESP_ZB_CORE_REPORT_ATTR_CB_ID = 0x2000, /*!< Attribute Report, refer to esp_zb_zcl_report_attr_message_t */ } esp_zb_core_action_callback_id_t; @@ -775,8 +795,15 @@ esp_err_t esp_zb_bdb_cancel_formation(void); /** * @brief Register a Zigbee device. * - * @note After successful registration, the SDK will retain a copy of the whole data model, the ep_list will be freed. - * @param[in] ep_list An endpoint list which wants to register @ref esp_zb_ep_list_s + * @note + * 1. After successful registration, the SDK will retain a copy of the whole data model, + * the \p ep_list will be freed. + * 2. For any lists (e.g. ``esp_zb_cluster_list_t`` and ``esp_zb_attribute_list_t``) added to the data + * modal should only be created and modified by the API. + * 3. Please DO NOT reuse ANY of lists in the data mode. If you have two identical stuff (e.g. two endpoints + * with identical clusters), please create/add them twice. + * + * @param[in] ep_list An endpoint list which wants to register, see @ref esp_zb_ep_list_s * * @return * - ESP_OK on success diff --git a/components/esp-zigbee-lib/include/esp_zigbee_endpoint.h b/components/esp-zigbee-lib/include/esp_zigbee_endpoint.h index 208d40e..5d391fa 100644 --- a/components/esp-zigbee-lib/include/esp_zigbee_endpoint.h +++ b/components/esp-zigbee-lib/include/esp_zigbee_endpoint.h @@ -19,7 +19,6 @@ extern "C" { */ esp_zb_ep_list_t *esp_zb_ep_list_create(void); - /** * @brief Add an endpoint (which includes cluster list) in a endpoint list. * @@ -34,6 +33,32 @@ esp_zb_ep_list_t *esp_zb_ep_list_create(void); */ esp_err_t esp_zb_ep_list_add_ep(esp_zb_ep_list_t *ep_list, esp_zb_cluster_list_t *cluster_list, esp_zb_endpoint_config_t endpoint_config); +/** + * @brief Add a gateway endpoint to the endpoint list. + * @param[in] ep_list A pointer to the endpoint list where the @p cluster_list will be added, @ref esp_zb_ep_list_s. + * @param[in] cluster_list A pointer to @ref esp_zb_cluster_list_s indicating the gateway's clusters. + * @param[in] endpoint_config The specific endpoint configuration, @ref esp_zb_endpoint_config_s. + * + * @return + * - ESP_OK on success. + * - ESP_ERR_NO_MEM if the number of gateways reaches the limit. + * - ESP_ERR_INVALID_ARG if the endpoint list is not initialized. + */ +esp_err_t esp_zb_ep_list_add_gateway_ep(esp_zb_ep_list_t *ep_list, esp_zb_cluster_list_t *cluster_list, esp_zb_endpoint_config_t endpoint_config); + +/** + * @brief Get endpoint (cluster list) from a endpoint list. + * + * @param[in] ep_list A pointer to endpoint list @ref esp_zb_ep_list_s + * @param[in] ep_id The endpoint id for cluster list + * + * @return + * - pointer to @ref esp_zb_cluster_list_s, if the endpoint is found in the endpoint list + * - ``NULL`` if endpoint is not found + * + */ +esp_zb_cluster_list_t *esp_zb_ep_list_get_ep(const esp_zb_ep_list_t *ep_list, uint8_t ep_id); + #ifdef __cplusplus } #endif diff --git a/components/esp-zigbee-lib/include/esp_zigbee_type.h b/components/esp-zigbee-lib/include/esp_zigbee_type.h index 362e32f..5ed5060 100644 --- a/components/esp-zigbee-lib/include/esp_zigbee_type.h +++ b/components/esp-zigbee-lib/include/esp_zigbee_type.h @@ -14,6 +14,7 @@ extern "C" { #include "stdbool.h" #define ESP_ZB_PACKED_STRUCT __attribute__ ((packed)) +#define ESP_ZB_DEPRECATED __attribute__((deprecated)) typedef uint8_t esp_zb_64bit_addr_t[8]; typedef esp_zb_64bit_addr_t esp_zb_ieee_addr_t; @@ -68,6 +69,8 @@ typedef struct esp_zb_zcl_cmd_cb_s { } ESP_ZB_PACKED_STRUCT esp_zb_zcl_cmd_cb_t; +/******************* attribute data model *******************/ + /** * @brief Type to represent ZCL attribute definition structure * @note Access define refer to zcl_attr_access @@ -81,6 +84,19 @@ typedef struct esp_zb_zcl_attr_s { } ESP_ZB_PACKED_STRUCT esp_zb_zcl_attr_t; +/** + * @brief The esp-zigbee data model of list of attribute. + * + * @note An attribute list groups up a single cluster. + */ +typedef struct esp_zb_attribute_list_s { + esp_zb_zcl_attr_t attribute; /*!< A single attribute */ + uint16_t cluster_id; /*!< A cluster id assigned to this attribute */ + struct esp_zb_attribute_list_s *next; /*!< A pointer to next attribute */ +} esp_zb_attribute_list_t; + +/******************* cluster data model *******************/ + /** * @brief Type to represent ZCL cluster definition structure * @note Cluster id refer to zcl_cluster_id and attribute define see @ref esp_zb_zcl_attr_s @@ -88,13 +104,25 @@ esp_zb_zcl_attr_t; typedef struct esp_zb_zcl_cluster_s { uint16_t cluster_id; /*!< ZCL 16-bit cluster id. Refer zcl_cluster_id */ uint16_t attr_count; /*!< Attributes number supported by the cluster */ - esp_zb_zcl_attr_t *attr_desc_list; /*!< List of cluster attributes esp_zb_zcl_attr_t */ + ESP_ZB_PACKED_STRUCT union { + esp_zb_zcl_attr_t *attr_desc_list; /*!< Array of cluster attributes esp_zb_zcl_attr_t */ + esp_zb_attribute_list_t* attr_list; /*!< List of cluster attributes esp_zb_attribute_list_t */ + }; uint8_t role_mask; /*!< Cluster role, refer to zcl_cluster_role */ uint16_t manuf_code; /*!< Manufacturer code for cluster and its attributes */ esp_zb_zcl_cluster_init_t cluster_init; /*!< cluster init callback function */ } ESP_ZB_PACKED_STRUCT esp_zb_zcl_cluster_t; +/** + * @brief The esp-zigbee data model of list of cluster. + * + */ +typedef struct esp_zb_cluster_list_s { + esp_zb_zcl_cluster_t cluster; /*!< A single cluster */ + struct esp_zb_cluster_list_s *next; /*!< A pointer to next cluster */ +} esp_zb_cluster_list_t; + /** * @brief Type to represent type signed int_24 * @note Internal use @@ -221,16 +249,6 @@ typedef struct esp_zb_af_node_desc_s { } ESP_ZB_PACKED_STRUCT esp_zb_af_node_desc_t; -/** -* @brief Struture of network descriptor request of active scan response -*/ -typedef struct esp_zb_network_descriptor_s{ - uint16_t short_pan_id; /*!< PAN id */ - bool permit_joining; /*!< Indicates that at least one router / coordinator on the network currently permits joining */ - esp_zb_ieee_addr_t extended_pan_id; /*!< Extended PAN id, the MAC address which forms the network */ -}ESP_ZB_PACKED_STRUCT -esp_zb_network_descriptor_t; - /** * @brief Structure of simple descriptor request of ZCL command */ @@ -257,10 +275,12 @@ typedef struct esp_zb_endpoint_config_s { } ESP_ZB_PACKED_STRUCT esp_zb_endpoint_config_t; +/******************* endpoint data model *******************/ + /** * @brief Type to represent ZCL endpoint definition structure * @note The esp_zb_zcl_reporting_info_t defines see @ref esp_zb_zcl_reporting_info_s -* @note The esp_zb_af_simple_desc_1_1_t defines see @ref esp_zb_af_simple_desc_1_1_s + * @note The esp_zb_af_simple_desc_1_1_t defines see @ref esp_zb_af_simple_desc_1_1_s */ typedef struct esp_zb_endpoint_s { uint8_t ep_id; /*!< Endpoint ID */ @@ -270,7 +290,10 @@ typedef struct esp_zb_endpoint_s { uint8_t reserved_size; /*!< Unused parameter (reserved for future use) */ void *reserved_ptr; /*!< Unused parameter (reserved for future use) */ uint8_t cluster_count; /*!< Number of supported clusters */ - esp_zb_zcl_cluster_t *cluster_desc_list; /*!< Supported clusters list */ + ESP_ZB_PACKED_STRUCT union { + esp_zb_zcl_cluster_t *cluster_desc_list; /*!< Supported clusters arranged in array */ + esp_zb_cluster_list_t *cluster_list; /*!< Supported clusters arranged in list */ + }; esp_zb_af_simple_desc_1_1_t *simple_desc; /*!< Simple descriptor */ #if defined ZB_ENABLE_ZLL uint8_t group_id_count; /*!< Number of group id */ @@ -282,29 +305,6 @@ typedef struct esp_zb_endpoint_s { } ESP_ZB_PACKED_STRUCT esp_zb_endpoint_t; -/******************* attribute list *******************/ -/** - * @brief The esp-zigbee data model of list of attribute. - * - * @note An attribute list groups up a single cluster. - */ -typedef struct esp_zb_attribute_list_s { - esp_zb_zcl_attr_t attribute; /*!< A single attribute */ - uint16_t cluster_id; /*!< A cluster id assigned to this attribute */ - struct esp_zb_attribute_list_s *next; /*!< A pointer to next attribute */ -} esp_zb_attribute_list_t; - -/******************* cluster list *******************/ -/** - * @brief The esp-zigbee data model of list of cluster. - * - */ -typedef struct esp_zb_cluster_list_s { - esp_zb_zcl_cluster_t cluster; /*!< A single cluster */ - struct esp_zb_cluster_list_s *next; /*!< A pointer to next cluster */ -} esp_zb_cluster_list_t; - -/******************* endpoint list *******************/ /** * @brief The esp-zigbee data model of list of endpoint. * @@ -482,6 +482,14 @@ typedef struct esp_zb_ias_zone_cluster_cfg_s { esp_zb_zcl_ias_zone_int_ctx_t zone_ctx; /*!< zone context*/ } esp_zb_ias_zone_cluster_cfg_t; +/** + * @brief Zigbee default attribute for IAS_WD cluster. + * + */ +typedef struct esp_zb_ias_wd_cluster_cfg_s { + uint16_t max_duration; /**< Max duration */ +} esp_zb_ias_wd_cluster_cfg_t; + /** * @brief Zigbee standard mandatory attribute for door lock cluster. * @@ -833,6 +841,28 @@ typedef struct esp_zb_thermostat_cfg_s { esp_zb_thermostat_cluster_cfg_t thermostat_cfg; /*!< Thermostat cluster configuration, @ref esp_zb_thermostat_cluster_cfg_s */ } esp_zb_thermostat_cfg_t; +/** + * @brief Zigbee HA window covering clusters. + * + */ +typedef struct esp_zb_window_covering_cfg_s { + esp_zb_basic_cluster_cfg_t basic_cfg; /*!< Basic cluster configuration, @ref esp_zb_basic_cluster_cfg_s */ + esp_zb_identify_cluster_cfg_t identify_cfg; /*!< Identify cluster configuration, @ref esp_zb_identify_cluster_cfg_s */ + esp_zb_groups_cluster_cfg_t groups_cfg; /*!< Groups cluster configuration, @ref esp_zb_groups_cluster_cfg_s */ + esp_zb_scenes_cluster_cfg_t scenes_cfg; /*!< Scenes cluster configuration, @ref esp_zb_scenes_cluster_cfg_s */ + esp_zb_window_covering_cluster_cfg_t window_cfg; /*!< Window covering cluster configuration, @ref esp_zb_window_covering_cluster_cfg_s */ +} esp_zb_window_covering_cfg_t; + +/** + * @brief Zigbee HA window covering controller clusters. + * + */ +typedef struct esp_zb_window_covering_controller_cfg_s { + esp_zb_basic_cluster_cfg_t basic_cfg; /*!< Basic cluster configuration, @ref esp_zb_basic_cluster_cfg_s */ + esp_zb_identify_cluster_cfg_t identify_cfg; /*!< Identify cluster configuration, @ref esp_zb_identify_cluster_cfg_s */ +} esp_zb_window_covering_controller_cfg_t; + + #ifdef __cplusplus } #endif diff --git a/components/esp-zigbee-lib/include/ha/esp_zigbee_ha_standard.h b/components/esp-zigbee-lib/include/ha/esp_zigbee_ha_standard.h index 53afad5..d549702 100644 --- a/components/esp-zigbee-lib/include/ha/esp_zigbee_ha_standard.h +++ b/components/esp-zigbee-lib/include/ha/esp_zigbee_ha_standard.h @@ -334,6 +334,57 @@ extern "C" { }, \ } +/** + * @brief Zigbee HA standard window covering device default config value. + * + */ +#define ESP_ZB_DEFAULT_WINDOW_COVERING_CONFIG() \ + { \ + .basic_cfg = \ + { \ + .zcl_version = ESP_ZB_ZCL_BASIC_ZCL_VERSION_DEFAULT_VALUE, \ + .power_source = ESP_ZB_ZCL_BASIC_POWER_SOURCE_DEFAULT_VALUE, \ + }, \ + .identify_cfg = \ + { \ + .identify_time = ESP_ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE, \ + }, \ + .groups_cfg = \ + { \ + .groups_name_support_id = ESP_ZB_ZCL_GROUPS_NAME_SUPPORT_DEFAULT_VALUE, \ + }, \ + .scenes_cfg = \ + { \ + .scenes_count = ESP_ZB_ZCL_SCENES_SCENE_COUNT_DEFAULT_VALUE, \ + .current_scene = ESP_ZB_ZCL_SCENES_CURRENT_SCENE_DEFAULT_VALUE, \ + .current_group = ESP_ZB_ZCL_SCENES_CURRENT_GROUP_DEFAULT_VALUE, \ + .scene_valid = ESP_ZB_ZCL_SCENES_SCENE_VALID_DEFAULT_VALUE, \ + .name_support = ESP_ZB_ZCL_SCENES_NAME_SUPPORT_DEFAULT_VALUE, \ + }, \ + .window_cfg = \ + { \ + . covering_type = ESP_ZB_ZCL_WINDOW_COVERING_WINDOW_COVERING_TYPE_DEFAULT_VALUE, \ + . covering_status = ESP_ZB_ZCL_WINDOW_COVERING_CONFIG_STATUS_DEFAULT_VALUE, \ + . covering_mode = ESP_ZB_ZCL_WINDOW_COVERING_MODE_DEFAULT_VALUE, \ + } \ + } + +/** + * @brief Zigbee HA standard window covering controller device default config value. + * + */ +#define ESP_ZB_DEFAULT_WINDOW_COVERING_CONTROLLER_CONFIG() \ + { \ + .basic_cfg = \ + { \ + .zcl_version = ESP_ZB_ZCL_BASIC_ZCL_VERSION_DEFAULT_VALUE, \ + .power_source = ESP_ZB_ZCL_BASIC_POWER_SOURCE_DEFAULT_VALUE, \ + }, \ + .identify_cfg = \ + { \ + .identify_time = ESP_ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE, \ + }, \ + } /********************************* Declare functions **************************************/ @@ -471,6 +522,23 @@ esp_zb_cluster_list_t *esp_zb_configuration_tool_clusters_create(esp_zb_configu */ esp_zb_cluster_list_t *esp_zb_thermostat_clusters_create(esp_zb_thermostat_cfg_t *thermostat); +/** + * @brief Create a standard HA window covering cluster list + * + * @note This contains basic, identify, group, scene and window_covering cluster as server side. + * @param[in] window Configuration parameters for this cluster lists defined by @ref esp_zb_window_covering_cfg_s + * @return Pointer to cluster list @ref esp_zb_cluster_list_s + */ +esp_zb_cluster_list_t *esp_zb_window_covering_clusters_create(esp_zb_window_covering_cfg_t *window); + +/** + * @brief Create a standard HA window covering controller cluster list + * + * @note This contains the basic and identify clusters as server side, and the identify and window_covering clusters as client side. + * @param[in] window_controller Configuration parameters for this cluster lists defined by @ref esp_zb_window_covering_controller_cfg_s + * @return Pointer to cluster list @ref esp_zb_cluster_list_s + */ +esp_zb_cluster_list_t *esp_zb_window_covering_controller_cluster_create(esp_zb_window_covering_controller_cfg_t *window_controller); /****************************** ZCL HA device standard endpoint list ********************************/ /** @@ -629,6 +697,26 @@ esp_zb_ep_list_t *esp_zb_configuration_tool_ep_create(uint8_t endpoint_id, esp_z */ esp_zb_ep_list_t *esp_zb_thermostat_ep_create(uint8_t endpoint_id, esp_zb_thermostat_cfg_t *thermostat); +/** + * @brief Create a standard single HA window covering endpoint. + * + * @param[in] endpoint_id The specific endpoint + * @param[in] window_covering Configuration parameters for this cluster lists defined by @ref esp_zb_window_covering_cfg_s + * + * @return Pointer to esp_zb_ep_list_t @ref esp_zb_ep_list_s + */ +esp_zb_ep_list_t *esp_zb_window_covering_ep_create(uint8_t endpoint_id, esp_zb_window_covering_cfg_t *window_covering); + +/** + * @brief Create a standard single HA window covering controller endpoint. + * + * @param[in] endpoint_id The specific endpoint + * @param[in] window_controller Configuration parameters for this cluster lists defined by @ref esp_zb_window_covering_controller_cfg_s + * + * @return Pointer to esp_zb_ep_list_t @ref esp_zb_ep_list_s + */ +esp_zb_ep_list_t *esp_zb_window_covering_controller_ep_create(uint8_t endpoint_id, esp_zb_window_covering_controller_cfg_t *window_controller); + #ifdef __cplusplus } #endif diff --git a/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_command.h b/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_command.h index c05714f..cc3b6e9 100644 --- a/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_command.h +++ b/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_command.h @@ -801,6 +801,24 @@ typedef struct esp_zb_zcl_ias_ace_bypass_cmd_s { esp_zb_zcl_ias_ace_bypass_t payload; /*!< Bypass command payload */ } esp_zb_zcl_ias_ace_bypass_cmd_t; +/** + * @brief The Zigbee ZCL IAS_WD Start Warning command struct + */ +typedef struct esp_zb_zcl_ias_wd_start_warning_cmd_s { + esp_zb_zcl_basic_cmd_t zcl_basic_cmd; /*!< Basic command info */ + esp_zb_zcl_address_mode_t address_mode; /*!< APS addressing mode constants refer to esp_zb_zcl_address_mode_t */ + esp_zb_zcl_ias_wd_start_warning_t payload; /*!< Start Warning command payload */ +} esp_zb_zcl_ias_wd_start_warning_cmd_t; + +/** + * @brief The Zigbee ZCL IAS_WD Squawk command struct + */ +typedef struct esp_zb_zcl_ias_wd_squawk_cmd_s { + esp_zb_zcl_basic_cmd_t zcl_basic_cmd; /*!< Basic command info */ + esp_zb_zcl_address_mode_t address_mode; /*!< APS addressing mode constants refer to esp_zb_zcl_address_mode_t */ + esp_zb_zcl_ias_wd_squawk_t payload; /*!< Squawk command payload */ +} esp_zb_zcl_ias_wd_squawk_cmd_t; + /** * @brief The Zigbee ZCL IAS_ACE Emergency command struct */ @@ -873,32 +891,29 @@ typedef struct esp_zb_zcl_ias_ace_panel_status_changed_cmd_s { * @note value only support uint8_t, uint16_t data types for the Lift/Tilt value/percentage payload. If not, set to NULL * */ -typedef struct esp_zb_zcl_window_covering_cluster_send_cmd_req_s{ +typedef struct esp_zb_zcl_window_covering_cluster_send_cmd_req_s { esp_zb_zcl_basic_cmd_t zcl_basic_cmd; /*!< Basic command info */ esp_zb_zcl_address_mode_t address_mode; /*!< APS addressing mode constants refer to esp_zb_zcl_address_mode_t */ - void *value; /*!< Pointer to value */ - uint16_t cluster_id; /*!< Cluster id */ - uint8_t cmd_id; /*!< Command id */ -}esp_zb_zcl_window_covering_cluster_send_cmd_req_t; + void *value; /*!< Pointer to payload value of window covering command */ + uint8_t cmd_id; /*!< Command id, refer to esp_zb_zcl_window_covering_cmd_t */ +} esp_zb_zcl_window_covering_cluster_send_cmd_req_t; /** * @brief The Zigbee ZCL electrical profile information response command struct */ -typedef struct esp_zb_zcl_electrical_profile_info_cmd_resp_s{ +typedef struct esp_zb_zcl_electrical_profile_info_cmd_resp_s { esp_zb_zcl_basic_cmd_t zcl_basic_cmd; /*!< Basic command info */ esp_zb_zcl_address_mode_t address_mode; /*!< APS addressing mode constants refer to esp_zb_zcl_address_mode_t */ esp_zb_electrical_measurement_profile_info_t profile_info; /*!< Electrical profile info response command */ - uint16_t cluster_id; /*!< Cluster id */ -}esp_zb_zcl_electrical_profile_info_cmd_resp_t; +} esp_zb_zcl_electrical_profile_info_cmd_resp_t; /** * @brief The Zigbee ZCL electrical profile response command struct */ -typedef struct esp_zb_zcl_electrical_measurement_profile_cmd_resp_s{ +typedef struct esp_zb_zcl_electrical_measurement_profile_cmd_resp_s { esp_zb_zcl_basic_cmd_t zcl_basic_cmd; /*!< Basic command info */ esp_zb_zcl_address_mode_t address_mode; /*!< APS addressing mode constants refer to esp_zb_zcl_address_mode_t */ esp_zb_electrical_measurement_profile_t profile; /*!< Electrical profile response command */ - uint16_t cluster_id; /*!< Cluster id */ } esp_zb_zcl_electrical_measurement_profile_cmd_resp_t; /** @@ -1344,6 +1359,24 @@ typedef struct esp_zb_zcl_ias_ace_get_zone_status_message_s { esp_zb_zcl_ias_ace_get_zone_status_resp_t *msg_out; /*!< Response of Get Zone Status command to be sent */ } esp_zb_zcl_ias_ace_get_zone_status_message_t; +/** + * @brief The Zigbee ZCL IAS_WD Start Warning message struct + * + */ +typedef struct esp_zb_zcl_ias_wd_start_warning_message_s { + esp_zb_device_cb_common_info_t info; /**< The common information for Zigbee device callback */ + const esp_zb_zcl_ias_wd_start_warning_t *msg_in; /**< Received Start Warning command, refer to esp_zb_zcl_ias_wd_start_warning_t */ +} esp_zb_zcl_ias_wd_start_warning_message_t; + +/** + * @brief The Zigbee ZCL IAS_WD Squawk message struct + * + */ +typedef struct esp_zb_zcl_ias_wd_squawk_message_s { + esp_zb_device_cb_common_info_t info; /**< The common information for Zigbee device callback */ + const esp_zb_zcl_ias_wd_squawk_t *msg_in; /**< Received Squawk command, refer to esp_zb_zcl_ias_wd_squawk_t */ +} esp_zb_zcl_ias_wd_squawk_message_t; + /** * @brief The Zigbee zcl ota upgrade value device callback message struct * @@ -1906,13 +1939,28 @@ typedef struct esp_zb_zcl_identify_effect_message_s { } esp_zb_zcl_identify_effect_message_t; /** - * @brief The Zigbee zcl basic cluster reset to factory defualt message + * @brief The Zigbee zcl basic cluster reset to factory default message * */ typedef struct esp_zb_zcl_basic_reset_factory_default_message_s { esp_zb_device_cb_common_info_t info; /*!< The common information for Zigbee device callback */ } esp_zb_zcl_basic_reset_factory_default_message_t; +/** + * @brief ZCL window covering movement message + * + */ +typedef struct esp_zb_zcl_window_covering_movement_message_s { + esp_zb_device_cb_common_info_t info; /*!< The common information for Zigbee device callback */ + uint16_t command; /*!< The movement command, refer to esp_zb_zcl_window_covering_cmd_t */ + union { + uint8_t percentage_lift_value; /*!< The payload for ESP_ZB_ZCL_CMD_WINDOW_COVERING_GO_TO_LIFT_PERCENTAGE */ + uint8_t percentage_tilt_value; /*!< The payload for ESP_ZB_ZCL_CMD_WINDOW_COVERING_GO_TO_TILT_PERCENTAGE */ + uint16_t lift_value; /*!< The payload for ESP_ZB_ZCL_CMD_WINDOW_COVERING_GO_TO_LIFT_VALUE */ + uint16_t tilt_value; /*!< The payload for ESP_ZB_ZCL_CMD_WINDOW_COVERING_GO_TO_TILT_VALUE */ + } payload; /*!< Command payload */ +} esp_zb_zcl_window_covering_movement_message_t; + /** * @brief The Zigbee zcl command basic application information struct * @@ -2965,6 +3013,24 @@ uint8_t esp_zb_zcl_ias_ace_zone_status_changed_cmd_req(esp_zb_zcl_ias_ace_zone_s */ uint8_t esp_zb_zcl_ias_ace_panel_status_changed_cmd_req(esp_zb_zcl_ias_ace_panel_status_changed_cmd_t *cmd_req); +/** + * @brief Send IAS_WD Start Warning command + * + * @param[in] cmd_req pointer to the Start Warning command @ref esp_zb_zcl_ias_wd_start_warning_cmd_s + * + * @return The transaction sequence number + */ +uint8_t esp_zb_zcl_ias_wd_start_warning_cmd_req(esp_zb_zcl_ias_wd_start_warning_cmd_t *cmd_req); + +/** + * @brief Send IAS_WD Squawk command + * + * @param[in] cmd_req pointer to the Squawk command @ref esp_zb_zcl_ias_wd_squawk_cmd_s + * + * @return The transaction sequence number + */ +uint8_t esp_zb_zcl_ias_wd_squawk_cmd_req(esp_zb_zcl_ias_wd_squawk_cmd_t *cmd_req); + /** * @brief Send window covering cluster command request * diff --git a/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_common.h b/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_common.h index e152561..88d0b95 100644 --- a/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_common.h +++ b/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_common.h @@ -24,6 +24,7 @@ extern "C" { #include "esp_zigbee_zcl_commissioning.h" #include "esp_zigbee_zcl_ias_zone.h" #include "esp_zigbee_zcl_ias_ace.h" +#include "esp_zigbee_zcl_ias_wd.h" #include "esp_zigbee_zcl_shade_config.h" #include "esp_zigbee_zcl_door_lock.h" #include "esp_zigbee_zcl_humidity_meas.h" @@ -172,6 +173,7 @@ typedef enum { ESP_ZB_ZCL_CLUSTER_ID_PM2_5_MEASUREMENT = 0x042aU, /*!< PM2.5 measurement */ ESP_ZB_ZCL_CLUSTER_ID_IAS_ZONE = 0x0500U, /*!< IAS zone */ ESP_ZB_ZCL_CLUSTER_ID_IAS_ACE = 0x0501U, /*!< IAS ACE */ + ESP_ZB_ZCL_CLUSTER_ID_IAS_WD = 0x0502U, /*!< IAS WD */ ESP_ZB_ZCL_CLUSTER_ID_PRICE = 0x0700U, /*!< Price cluster identifier. */ ESP_ZB_ZCL_CLUSTER_ID_METERING = 0x0702U, /*!< Metering */ ESP_ZB_ZCL_CLUSTER_ID_METER_IDENTIFICATION = 0x0b01U, /*!< Meter Identification cluster identifier */ diff --git a/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_ias_wd.h b/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_ias_wd.h new file mode 100644 index 0000000..a568eec --- /dev/null +++ b/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_ias_wd.h @@ -0,0 +1,113 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once +#ifdef __cplusplus +extern "C" { +#endif + +#include "esp_zigbee_type.h" + +/** @brief IAS WD cluster attribute identifiers. */ +typedef enum { + ESP_ZB_ZCL_ATTR_IAS_WD_MAX_DURATION_ID = 0x0000, /**< Max Duration attribute */ +} esp_zb_zcl_ias_wd_attr_t; + +/** @brief Default value for IAS WD cluster revision global attribute */ +#define ESP_ZB_ZCL_IAS_WD_CLUSTER_REVISION_DEFAULT ((uint16_t)0x0002u) + +/** @brief Max Duration attribute default value */ +#define ESP_ZB_ZCL_ATTR_IAS_WD_MAX_DURATION_DEF_VALUE 240 + +/** @brief Max Duration attribute minimum value */ +#define ESP_ZB_ZCL_ATTR_IAS_WD_MAX_DURATION_MIN_VALUE 0 + +/** @brief Max Duration attribute maximum value */ +#define ESP_ZB_ZCL_ATTR_IAS_WD_MAX_DURATION_MAX_VALUE 0xfffe + +/** @brief IAS WD cluster command identifiers */ +typedef enum { + ESP_ZB_ZCL_CMD_IAS_WD_START_WARNING_ID = 0x00, /**< Start warning command. */ + ESP_ZB_ZCL_CMD_IAS_WD_SQUAWK_ID = 0x01, /**< Squawk command. */ +} esp_zb_zcl_ias_wd_cmd_t; + +/******************************* Start warning command ******************************/ + +/** @brief Values of Warning Mode Field. */ +typedef enum { + ESP_ZB_ZCL_IAS_WD_WARNING_MODE_STOP = 0x00, /**< Stop */ + ESP_ZB_ZCL_IAS_WD_WARNING_MODE_BURGLAR = 0x01, /**< Burglar */ + ESP_ZB_ZCL_IAS_WD_WARNING_MODE_FIRE = 0x02, /**< Fire */ + ESP_ZB_ZCL_IAS_WD_WARNING_MODE_EMERGENCY = 0x03, /**< Emergency */ + ESP_ZB_ZCL_IAS_WD_WARNING_MODE_POLICE_PANIC = 0x04, /**< Police panic */ + ESP_ZB_ZCL_IAS_WD_WARNING_MODE_FIRE_PANIC = 0x05, /**< Fire panic */ + ESP_ZB_ZCL_IAS_WD_WARNING_MODE_EMERGENCY_PANIC = 0x06, /**< Emergency panic (i.e., medical issue) */ +} esp_zb_zcl_ias_wd_warning_mode_t; + +/** @brief Values of Strobe Field. */ +typedef enum { + ESP_ZB_ZCL_IAS_WD_STROBE_NO_STROBE = 0x00, /**< No strobe */ + ESP_ZB_ZCL_IAS_WD_STROBE_USE_STROBE = 0x01, /**< Use strobe in parallel to warning */ +} esp_zb_zcl_ias_wd_strobe_t; + +/** @brief Values of Siren Level Field. */ +typedef enum { + ESP_ZB_ZCL_IAS_WD_SIREN_LEVEL_LOW = 0x00, /**< Low level sound */ + ESP_ZB_ZCL_IAS_WD_SIREN_LEVEL_MEDIUM = 0x01, /**< Medium level sound */ + ESP_ZB_ZCL_IAS_WD_SIREN_LEVEL_HIGH = 0x02, /**< High level sound */ + ESP_ZB_ZCL_IAS_WD_SIREN_LEVEL_VERY_HIGH = 0x03, /**< Very high level sound */ +} esp_zb_zcl_ias_wd_siren_level_t; + +/** @brief Values of Strobe Level Field. */ +typedef enum { + ESP_ZB_ZCL_IAS_WD_STROBE_LEVEL_LOW = 0x00, /**< Low level strobe */ + ESP_ZB_ZCL_IAS_WD_STROBE_LEVEL_MEDIUM = 0x01, /**< Medium level strobe */ + ESP_ZB_ZCL_IAS_WD_STROBE_LEVEL_HIGH = 0x02, /**< High level strobe */ + ESP_ZB_ZCL_IAS_WD_STROBE_LEVEL_VERY_HIGH = 0x03, /**< Very high level strobe */ +} esp_zb_zcl_ias_wd_strobe_level_t; + +/** @brief Data in IAS_WD Start Warning command */ +typedef struct esp_zb_zcl_ias_wd_start_warning_s { + uint8_t warning_mode; /**< Warning Mode */ + uint8_t strobe; /**< Strobe */ + uint8_t siren_level; /**< Siren level */ + uint16_t duration; /**< Duration */ + uint8_t strobe_duty_cycle; /**< Strobe duty cycle */ + uint8_t strobe_level; /**< Strobe level */ +} esp_zb_zcl_ias_wd_start_warning_t; + +/******************************* Squawk command ******************************/ + +/** @brief Values of Squawk Mode Field. */ +typedef enum { + ESP_ZB_ZCL_IAS_WD_SQUAWK_MODE_ARMED = 0x00, /**< Notification sound for "System is armed" */ + ESP_ZB_ZCL_IAS_WD_SQUAWK_MODE_DISARMED = 0x01, /**< Notification sound for "System is disarmed" */ +} esp_zb_zcl_ias_wd_squawk_mode_t; + +/** @brief Values of Strobe Field. */ +typedef enum { + ESP_ZB_ZCL_IAS_WD_SQUAWK_STROBE_NO_STROBE = 0x00, /**< No strobe*/ + ESP_ZB_ZCL_IAS_WD_SQUAWK_STROBE_USE_STROBE = 0x01, /**< Use strobe blink in parallel to squawk */ +} esp_zb_zcl_ias_wd_squawk_strobe_t; + +/** @brief Values of Squawk level Field. */ +typedef enum { + ESP_ZB_ZCL_IAS_WD_SQUAWK_LEVEL_LOW = 0x00, /**< Low level sound */ + ESP_ZB_ZCL_IAS_WD_SQUAWK_LEVEL_MEDIUM = 0x01, /**< Medium level sound */ + ESP_ZB_ZCL_IAS_WD_SQUAWK_LEVEL_HIGH = 0x02, /**< High level sound */ + ESP_ZB_ZCL_IAS_WD_SQUAWK_LEVEL_VERY_HIGH = 0x03, /**< Very High level sound */ +} esp_zb_zcl_ias_wd_squawk_level_t; + +/** @brief Data in IAS_WD Squawk command */ +typedef struct esp_zb_zcl_ias_wd_squawk_s { + uint8_t squawk_mode; /**< Squawk Mode */ + uint8_t strobe; /**< Strobe */ + uint8_t squawk_level; /**< Squawk level */ +} esp_zb_zcl_ias_wd_squawk_t; + +#ifdef __cplusplus +} +#endif diff --git a/components/esp-zigbee-lib/include/zdo/esp_zigbee_zdo_command.h b/components/esp-zigbee-lib/include/zdo/esp_zigbee_zdo_command.h index 4121352..1c05391 100644 --- a/components/esp-zigbee-lib/include/zdo/esp_zigbee_zdo_command.h +++ b/components/esp-zigbee-lib/include/zdo/esp_zigbee_zdo_command.h @@ -5,10 +5,10 @@ */ #pragma once -#include "esp_err.h" #ifdef __cplusplus extern "C" { #endif +#include "esp_err.h" #include "esp_zigbee_type.h" #include "esp_zigbee_zdo_common.h" @@ -25,20 +25,6 @@ extern "C" { #define ESP_ZB_DEVICE_LEAVE_REQ_TIMEOUT (5 * ESP_ZB_TIME_ONE_SECOND) /* timeout for device leave */ #define ESP_ZB_DEVICE_BIND_TABLE_REQ_TIMEOUT (5 * ESP_ZB_TIME_ONE_SECOND) /* timeout for device bind table request */ - -/** Active scan network callback - * - * @brief A ZDO active scan request callback for user to get scan list status. - * - * @note User's callback get response from the device that found in network. - * - * @param[in] zdo_status The ZDO response status, refer to `esp_zb_zdp_status` - * @param[in] count Number of discovered networks - * @param[in] nwk_descriptor The pointer to all discvoered networks see refer to esp_zb_network_descriptor_t - * - */ -typedef void (*esp_zb_zdo_scan_complete_callback_t)(esp_zb_zdp_status_t zdo_status, uint8_t count, esp_zb_network_descriptor_t *nwk_descriptor); - /** Find device callback * * @brief A ZDO match desc request callback for user to get response info. @@ -277,6 +263,54 @@ typedef struct esp_zb_zdo_binding_table_info_s { esp_zb_zdo_binding_table_record_t *record; /*!< The binding table record list */ } esp_zb_zdo_binding_table_info_t; +/** +* @brief Struture of network descriptor request of active scan response +*/ +typedef struct esp_zb_network_descriptor_s{ + uint16_t short_pan_id; /*!< PAN id */ + bool permit_joining; /*!< Indicates that at least one router / coordinator on the network currently permits joining */ + esp_zb_ieee_addr_t extended_pan_id; /*!< Extended PAN id, the MAC address which forms the network */ + uint8_t logic_channel; /*!< The current logical channel occupied by the network. */ + bool router_capacity; /*!< This value is set to true if the device is capable of accepting join requests from router-capable + devices and set to FALSE otherwise. */ + bool end_device_capacity; /*!< This value is set to true if the device is capable of accepting join requests from end devices + and set to FALSE otherwise.*/ +} esp_zb_network_descriptor_t; + +/** + * @brief Channel information of Energy Detect + * + */ +typedef struct esp_zb_energy_detect_channel_info_s { + uint8_t channel_number; /*!< The channel of energy detect */ + int8_t energy_detected; /*!< The energy value of channel in dbm */ +} esp_zb_energy_detect_channel_info_t; + +/** Active scan network callback + * + * @brief A ZDO active scan request callback for user to get scan list status. + * + * @note User's callback get response from the device that found in network. + * + * @param[in] zdo_status The ZDO response status, refer to esp_zb_zdp_status_t + * @param[in] count Number of discovered networks @p nwk_descriptor + * @param[in] nwk_descriptor The pointer to all discovered networks see refer to esp_zb_network_descriptor_t + * + */ +typedef void (*esp_zb_zdo_scan_complete_callback_t)(esp_zb_zdp_status_t zdo_status, uint8_t count, + esp_zb_network_descriptor_t *nwk_descriptor); + +/** + * @brief ZDO energy detect callback + * + * @param[in] status The status of callback, refer to esp_zb_zdp_status_t + * @param[in] count The size of energy detect list + * @param[in] ed_list The list of energy detect information, refer to esp_zb_energy_detect_channel_info_t + * + */ +typedef void (*esp_zb_zdo_energy_detect_callback_t)(esp_zb_zdp_status_t status, uint16_t count, + esp_zb_energy_detect_channel_info_t *channel_info); + /** Binding table request callback * * @brief A ZDO binding table request callback for user to get the binding table record of remote device. @@ -296,11 +330,20 @@ typedef void (*esp_zb_zdo_binding_table_callback_t)(const esp_zb_zdo_binding_tab * Network discovery service for scanning available network * * @param[in] channel_mask Valid channel mask is from 0x00000800 (only channel 11) to 0x07FFF800 (all channels from 11 to 26) - * @param[in] scan_duration Time to spend scanning each channel + * @param[in] scan_duration Time spent scanning each channel, in units of ((1 << scan_duration) + 1) * a beacon time. * @param[in] user_cb A user callback to get the active scan result please refer to esp_zb_zdo_scan_complete_callback_t */ void esp_zb_zdo_active_scan_request(uint32_t channel_mask, uint8_t scan_duration, esp_zb_zdo_scan_complete_callback_t user_cb); +/** + * @brief Energy detect request + * + * @param[in] channel_mask The channel mask that will trigger the energy detection, with a range from 0x00000800 to 0x07FFF800. + * @param[in] duration The detection duration on each channel, in units of ((1 << scan_duration) + 1) * a beacon time. + * @param[in] cb A user callback to receive the energy detection result, see esp_zb_zdo_energy_detect_callback_t. + */ +void esp_zb_zdo_energy_detect_request(uint32_t channel_mask, uint8_t duration, esp_zb_zdo_energy_detect_callback_t cb); + /** * @brief Send bind device request command * diff --git a/components/esp-zigbee-lib/lib/esp32/libesp_zb_api_zczr.a b/components/esp-zigbee-lib/lib/esp32/libesp_zb_api_zczr.a index 2c6b46b..f2bc169 100644 Binary files a/components/esp-zigbee-lib/lib/esp32/libesp_zb_api_zczr.a and b/components/esp-zigbee-lib/lib/esp32/libesp_zb_api_zczr.a differ diff --git a/components/esp-zigbee-lib/lib/esp32/libesp_zb_api_zczr.debug.a b/components/esp-zigbee-lib/lib/esp32/libesp_zb_api_zczr.debug.a index 5772aa2..f98dcc6 100644 Binary files a/components/esp-zigbee-lib/lib/esp32/libesp_zb_api_zczr.debug.a and b/components/esp-zigbee-lib/lib/esp32/libesp_zb_api_zczr.debug.a differ diff --git a/components/esp-zigbee-lib/lib/esp32/libesp_zb_cli_command.a b/components/esp-zigbee-lib/lib/esp32/libesp_zb_cli_command.a index c34ba27..3e86f7d 100644 Binary files a/components/esp-zigbee-lib/lib/esp32/libesp_zb_cli_command.a and b/components/esp-zigbee-lib/lib/esp32/libesp_zb_cli_command.a differ diff --git a/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_api_zczr.a b/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_api_zczr.a index 89074ab..9a91525 100644 Binary files a/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_api_zczr.a and b/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_api_zczr.a differ diff --git a/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_api_zczr.debug.a b/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_api_zczr.debug.a index c04986b..6c78803 100644 Binary files a/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_api_zczr.debug.a and b/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_api_zczr.debug.a differ diff --git a/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_cli_command.a b/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_cli_command.a index 3d838bd..b564ebc 100644 Binary files a/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_cli_command.a and b/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_cli_command.a differ diff --git a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_ed.a b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_ed.a index c6579a9..abbe515 100644 Binary files a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_ed.a and b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_ed.a differ diff --git a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_ed.debug.a b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_ed.debug.a index 6b1d855..0f2a3e2 100644 Binary files a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_ed.debug.a and b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_ed.debug.a differ diff --git a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_gpd.a b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_gpd.a index 64c8a7b..f4c62ea 100644 Binary files a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_gpd.a and b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_gpd.a differ diff --git a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_zczr.a b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_zczr.a index 90f5c70..f5d23bc 100644 Binary files a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_zczr.a and b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_zczr.a differ diff --git a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_zczr.debug.a b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_zczr.debug.a index 5a2c255..ad07dfb 100644 Binary files a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_zczr.debug.a and b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_zczr.debug.a differ diff --git a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_cli_command.a b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_cli_command.a index f6e1943..d3e33fd 100644 Binary files a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_cli_command.a and b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_cli_command.a differ diff --git a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_ed.a b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_ed.a index 561e209..7ea13ab 100644 Binary files a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_ed.a and b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_ed.a differ diff --git a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_ed.debug.a b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_ed.debug.a index c4e77f8..76270bf 100644 Binary files a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_ed.debug.a and b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_ed.debug.a differ diff --git a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_gpd.a b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_gpd.a index 64c8a7b..f4c62ea 100644 Binary files a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_gpd.a and b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_gpd.a differ diff --git a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_zczr.a b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_zczr.a index 55f5949..6596d55 100644 Binary files a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_zczr.a and b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_zczr.a differ diff --git a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_zczr.debug.a b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_zczr.debug.a index cc29ff7..c6ff46c 100644 Binary files a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_zczr.debug.a and b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_zczr.debug.a differ diff --git a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_cli_command.a b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_cli_command.a index f6e1943..d3e33fd 100644 Binary files a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_cli_command.a and b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_cli_command.a differ diff --git a/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_api_zczr.a b/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_api_zczr.a index a7e909d..5c0e77b 100644 Binary files a/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_api_zczr.a and b/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_api_zczr.a differ diff --git a/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_api_zczr.debug.a b/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_api_zczr.debug.a index 5772aa2..f98dcc6 100644 Binary files a/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_api_zczr.debug.a and b/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_api_zczr.debug.a differ diff --git a/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_cli_command.a b/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_cli_command.a index c34ba27..3e86f7d 100644 Binary files a/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_cli_command.a and b/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_cli_command.a differ diff --git a/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_api_zczr.a b/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_api_zczr.a index 2c6b46b..f2bc169 100644 Binary files a/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_api_zczr.a and b/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_api_zczr.a differ diff --git a/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_api_zczr.debug.a b/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_api_zczr.debug.a index 5772aa2..f98dcc6 100644 Binary files a/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_api_zczr.debug.a and b/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_api_zczr.debug.a differ diff --git a/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_cli_command.a b/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_cli_command.a index c34ba27..3e86f7d 100644 Binary files a/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_cli_command.a and b/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_cli_command.a differ diff --git a/docs/Doxyfile b/docs/Doxyfile index 1ebb727..dd88c6c 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -71,6 +71,7 @@ INPUT = \ $(PROJECT_PATH)/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_price.h \ $(PROJECT_PATH)/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_commissioning.h \ $(PROJECT_PATH)/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_ias_ace.h \ + $(PROJECT_PATH)/components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_ias_wd.h \ $(PROJECT_PATH)/components/esp-zigbee-lib/include/zdo/esp_zigbee_zdo_command.h \ $(PROJECT_PATH)/components/esp-zigbee-lib/include/zdo/esp_zigbee_zdo_common.h \ $(PROJECT_PATH)/components/esp-zigbee-lib/include/bdb/esp_zigbee_bdb_touchlink.h \ @@ -92,7 +93,9 @@ ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES PREDEFINED = \ - $(ENV_DOXYGEN_DEFINES) + $(ENV_DOXYGEN_DEFINES) \ + __attribute__(x)= \ + "ESP_ZB_DEPRECATED=" \ ## Do not complain about not having dot ## diff --git a/docs/en/api-reference/zcl/esp_zigbee_zcl_ias_wd.rst b/docs/en/api-reference/zcl/esp_zigbee_zcl_ias_wd.rst new file mode 100644 index 0000000..52c860e --- /dev/null +++ b/docs/en/api-reference/zcl/esp_zigbee_zcl_ias_wd.rst @@ -0,0 +1,7 @@ +ZCL IAS WD +========== + +Zigbee Cluster Library (ZCL) IAS WD cluster usage definition for ESP Zigbee SDK. + + +.. include-build-file:: inc/esp_zigbee_zcl_ias_wd.inc diff --git a/docs/en/api-reference/zcl/index.rst b/docs/en/api-reference/zcl/index.rst index 8927dda..a5d466b 100644 --- a/docs/en/api-reference/zcl/index.rst +++ b/docs/en/api-reference/zcl/index.rst @@ -48,3 +48,4 @@ This section provides the ESP Zigbee SDK's APIs that support different kind of Z esp_zigbee_zcl_flow_measurement esp_zigbee_zcl_commissioning esp_zigbee_zcl_ias_ace + esp_zigbee_zcl_ias_wd \ No newline at end of file diff --git a/docs/en/introduction.rst b/docs/en/introduction.rst index 14b4136..4ea1f0f 100644 --- a/docs/en/introduction.rst +++ b/docs/en/introduction.rst @@ -110,6 +110,8 @@ The supported features in current ESP Zigbee SDK are listed below: carbon_dioxide_measurement 0x040d PM2.5_measurement 0x042a ias_zone 0x0500 + ias_ace 0x0501 + ias_wd 0x0502 price 0x0700 metering 0x0702 meter_identification 0x0b01 diff --git a/examples/common/zcl_utility/include/zcl_utility.h b/examples/common/zcl_utility/include/zcl_utility.h new file mode 100644 index 0000000..894b8cd --- /dev/null +++ b/examples/common/zcl_utility/include/zcl_utility.h @@ -0,0 +1,51 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: CC0-1.0 + * + * Zigbee light driver example + * + * This example code is in the Public Domain (or CC0 licensed, at your option.) + * + * Unless required by applicable law or agreed to in writing, this + * software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "esp_err.h" +#include "esp_check.h" +#include "esp_zigbee_core.h" + +/*! Maximum length of ManufacturerName string field */ +#define ESP_ZB_ZCL_CLUSTER_ID_BASIC_MANUFACTURER_NAME_MAX_LEN 32 + +/*! Maximum length of ModelIdentifier string field */ +#define ESP_ZB_ZCL_CLUSTER_ID_BASIC_MODEL_IDENTIFIER_MAX_LEN 32 + +/** optional basic manufacturer information */ +typedef struct zcl_basic_manufacturer_info_s { + char *manufacturer_name; + char *model_identifier; +} zcl_basic_manufacturer_info_t; + +/** + * @brief Adds manufacturer information to the ZCL basic cluster of endpoint + * + * @param[in] ep_list The pointer to the endpoint list with @p endpoint_id + * @param[in] endpoint_id The endpoint identifier indicating where the ZCL basic cluster resides + * @param[in] info The pointer to the basic manufacturer information + * @return + * - ESP_OK: On success + * - ESP_ERR_INVALID_ARG: Invalid argument + */ +esp_err_t esp_zcl_utility_add_ep_basic_manufacturer_info(esp_zb_ep_list_t *ep_list, uint8_t endpoint_id, zcl_basic_manufacturer_info_t *info); + +#ifdef __cplusplus +} // extern "C" +#endif \ No newline at end of file diff --git a/examples/common/zcl_utility/src/zcl_utility.c b/examples/common/zcl_utility/src/zcl_utility.c new file mode 100644 index 0000000..af29e93 --- /dev/null +++ b/examples/common/zcl_utility/src/zcl_utility.c @@ -0,0 +1,37 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: CC0-1.0 + * + * Zigbee light driver example + * + * This example code is in the Public Domain (or CC0 licensed, at your option.) + * + * Unless required by applicable law or agreed to in writing, this + * software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. + */ +#include "esp_check.h" +#include "stdio.h" +#include "string.h" +#include "zcl_utility.h" +#include + +static const char *TAG = "ZCL_UTILITY"; + +esp_err_t esp_zcl_utility_add_ep_basic_manufacturer_info(esp_zb_ep_list_t *ep_list, uint8_t endpoint_id, zcl_basic_manufacturer_info_t *info) +{ + esp_err_t ret = ESP_OK; + esp_zb_cluster_list_t *cluster_list = NULL; + esp_zb_attribute_list_t *basic_cluster = NULL; + + cluster_list = esp_zb_ep_list_get_ep(ep_list, endpoint_id); + ESP_RETURN_ON_FALSE(cluster_list, ESP_ERR_INVALID_ARG, TAG, "Failed to find endpoint id: %d in list: %p", endpoint_id, ep_list); + basic_cluster = esp_zb_cluster_list_get_cluster(cluster_list, ESP_ZB_ZCL_CLUSTER_ID_BASIC, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + ESP_RETURN_ON_FALSE(basic_cluster, ESP_ERR_INVALID_ARG, TAG, "Failed to find basic cluster in endpoint: %d", endpoint_id); + ESP_RETURN_ON_FALSE((info && info->manufacturer_name), ESP_ERR_INVALID_ARG, TAG, "Invalid manufacturer name"); + ESP_ERROR_CHECK(esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, info->manufacturer_name)); + ESP_RETURN_ON_FALSE((info && info->model_identifier), ESP_ERR_INVALID_ARG, TAG, "Invalid model identifier"); + ESP_ERROR_CHECK(esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID, info->model_identifier)); + return ret; +} diff --git a/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/CMakeLists.txt b/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/CMakeLists.txt index eb3eeec..a0f0b9b 100644 --- a/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/CMakeLists.txt +++ b/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/CMakeLists.txt @@ -1,5 +1,4 @@ idf_component_register( - SRCS - "esp_zb_light.c" - INCLUDE_DIRS "." + SRC_DIRS "." "../../../common/zcl_utility/src" + INCLUDE_DIRS "." "../../../common/zcl_utility/include" ) diff --git a/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/esp_zb_light.c b/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/esp_zb_light.c index 1e8ef0a..ef5aa33 100644 --- a/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/esp_zb_light.c +++ b/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/esp_zb_light.c @@ -169,6 +169,12 @@ static void esp_zb_task(void *pvParameters) esp_zb_init(&zb_nwk_cfg); esp_zb_color_dimmable_light_cfg_t light_cfg = ESP_ZB_DEFAULT_COLOR_DIMMABLE_LIGHT_CONFIG(); esp_zb_ep_list_t *esp_zb_color_dimmable_light_ep = esp_zb_color_dimmable_light_ep_create(HA_COLOR_DIMMABLE_LIGHT_ENDPOINT, &light_cfg); + zcl_basic_manufacturer_info_t info = { + .manufacturer_name = ESP_MANUFACTURER_NAME, + .model_identifier = ESP_MODEL_IDENTIFIER, + }; + + esp_zcl_utility_add_ep_basic_manufacturer_info(esp_zb_color_dimmable_light_ep, HA_COLOR_DIMMABLE_LIGHT_ENDPOINT, &info); esp_zb_device_register(esp_zb_color_dimmable_light_ep); esp_zb_core_action_handler_register(zb_action_handler); esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK); diff --git a/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/esp_zb_light.h b/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/esp_zb_light.h index 8e40662..6677454 100644 --- a/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/esp_zb_light.h +++ b/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/esp_zb_light.h @@ -14,6 +14,7 @@ #include "esp_zigbee_core.h" #include "light_driver.h" +#include "zcl_utility.h" /* Zigbee configuration */ #define MAX_CHILDREN 10 /* the max amount of connected devices */ @@ -21,6 +22,10 @@ #define HA_COLOR_DIMMABLE_LIGHT_ENDPOINT 10 /* esp light switch device endpoint */ #define ESP_ZB_PRIMARY_CHANNEL_MASK ESP_ZB_TRANSCEIVER_ALL_CHANNELS_MASK /* Zigbee primary channel mask use in the example */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZR_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_ROUTER, \ diff --git a/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/idf_component.yml b/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/idf_component.yml index ebc68a4..7d754da 100644 --- a/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/idf_component.yml +++ b/examples/esp_zigbee_HA_sample/HA_color_dimmable_light/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" espressif/led_strip: "~2.0.0" ## Required IDF version idf: diff --git a/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/CMakeLists.txt b/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/CMakeLists.txt index 285ed85..15343ef 100644 --- a/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/CMakeLists.txt +++ b/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/CMakeLists.txt @@ -1,5 +1,4 @@ idf_component_register( - SRCS - "esp_zb_switch.c" - INCLUDE_DIRS "." + SRC_DIRS "." "../../../common/zcl_utility/src" + INCLUDE_DIRS "." "../../../common/zcl_utility/include" ) diff --git a/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/esp_zb_switch.c b/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/esp_zb_switch.c index 31b5e63..6a6fa86 100644 --- a/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/esp_zb_switch.c +++ b/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/esp_zb_switch.c @@ -207,6 +207,12 @@ static void esp_zb_task(void *pvParameters) /* set the color dimmable switch device config */ esp_zb_color_dimmable_switch_cfg_t switch_cfg = ESP_ZB_DEFAULT_COLOR_DIMMABLE_SWITCH_CONFIG(); esp_zb_ep_list_t *esp_zb_color_dimm_switch_ep = esp_zb_color_dimmable_switch_ep_create(HA_COLOR_DIMMABLE_SWITCH_ENDPOINT, &switch_cfg); + zcl_basic_manufacturer_info_t info = { + .manufacturer_name = ESP_MANUFACTURER_NAME, + .model_identifier = ESP_MODEL_IDENTIFIER, + }; + + esp_zcl_utility_add_ep_basic_manufacturer_info(esp_zb_color_dimm_switch_ep, HA_COLOR_DIMMABLE_SWITCH_ENDPOINT, &info); esp_zb_device_register(esp_zb_color_dimm_switch_ep); esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK); ESP_ERROR_CHECK(esp_zb_start(false)); diff --git a/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/esp_zb_switch.h b/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/esp_zb_switch.h index dd0b91a..df96b01 100644 --- a/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/esp_zb_switch.h +++ b/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/esp_zb_switch.h @@ -13,6 +13,7 @@ */ #include "esp_zigbee_core.h" #include "switch_driver.h" +#include "zcl_utility.h" /* Zigbee configuration */ #define MAX_CHILDREN 10 /* the max amount of connected devices */ @@ -20,6 +21,10 @@ #define HA_COLOR_DIMMABLE_SWITCH_ENDPOINT 1 /* esp light switch device endpoint */ #define ESP_ZB_PRIMARY_CHANNEL_MASK (1l << 13) /* Zigbee primary channel mask use in the example */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZC_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_COORDINATOR, \ diff --git a/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/idf_component.yml b/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/idf_component.yml index 55ab41e..067b6aa 100644 --- a/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/idf_component.yml +++ b/examples/esp_zigbee_HA_sample/HA_color_dimmable_switch/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" ## Required IDF version idf: version: ">=5.0.0" diff --git a/examples/esp_zigbee_HA_sample/HA_on_off_light/main/CMakeLists.txt b/examples/esp_zigbee_HA_sample/HA_on_off_light/main/CMakeLists.txt index eb3eeec..15343ef 100644 --- a/examples/esp_zigbee_HA_sample/HA_on_off_light/main/CMakeLists.txt +++ b/examples/esp_zigbee_HA_sample/HA_on_off_light/main/CMakeLists.txt @@ -1,5 +1,4 @@ idf_component_register( - SRCS - "esp_zb_light.c" - INCLUDE_DIRS "." + SRC_DIRS "." "../../../common/zcl_utility/src" + INCLUDE_DIRS "." "../../../common/zcl_utility/include" ) diff --git a/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.c b/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.c index fae4a53..734c3cb 100644 --- a/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.c +++ b/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.c @@ -125,6 +125,12 @@ static void esp_zb_task(void *pvParameters) esp_zb_init(&zb_nwk_cfg); esp_zb_on_off_light_cfg_t light_cfg = ESP_ZB_DEFAULT_ON_OFF_LIGHT_CONFIG(); esp_zb_ep_list_t *esp_zb_on_off_light_ep = esp_zb_on_off_light_ep_create(HA_ESP_LIGHT_ENDPOINT, &light_cfg); + zcl_basic_manufacturer_info_t info = { + .manufacturer_name = ESP_MANUFACTURER_NAME, + .model_identifier = ESP_MODEL_IDENTIFIER, + }; + + esp_zcl_utility_add_ep_basic_manufacturer_info(esp_zb_on_off_light_ep, HA_ESP_LIGHT_ENDPOINT, &info); esp_zb_device_register(esp_zb_on_off_light_ep); esp_zb_core_action_handler_register(zb_action_handler); esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK); diff --git a/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.h b/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.h index a93cf78..7d00f62 100644 --- a/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.h +++ b/examples/esp_zigbee_HA_sample/HA_on_off_light/main/esp_zb_light.h @@ -14,6 +14,7 @@ #include "esp_zigbee_core.h" #include "light_driver.h" +#include "zcl_utility.h" /* Zigbee configuration */ #define INSTALLCODE_POLICY_ENABLE false /* enable the install code policy for security */ @@ -22,6 +23,10 @@ #define HA_ESP_LIGHT_ENDPOINT 10 /* esp light bulb device endpoint, used to process light controlling commands */ #define ESP_ZB_PRIMARY_CHANNEL_MASK ESP_ZB_TRANSCEIVER_ALL_CHANNELS_MASK /* Zigbee primary channel mask use in the example */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZED_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_ED, \ diff --git a/examples/esp_zigbee_HA_sample/HA_on_off_light/main/idf_component.yml b/examples/esp_zigbee_HA_sample/HA_on_off_light/main/idf_component.yml index ebc68a4..7d754da 100644 --- a/examples/esp_zigbee_HA_sample/HA_on_off_light/main/idf_component.yml +++ b/examples/esp_zigbee_HA_sample/HA_on_off_light/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" espressif/led_strip: "~2.0.0" ## Required IDF version idf: diff --git a/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/CMakeLists.txt b/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/CMakeLists.txt index 285ed85..15343ef 100644 --- a/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/CMakeLists.txt +++ b/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/CMakeLists.txt @@ -1,5 +1,4 @@ idf_component_register( - SRCS - "esp_zb_switch.c" - INCLUDE_DIRS "." + SRC_DIRS "." "../../../common/zcl_utility/src" + INCLUDE_DIRS "." "../../../common/zcl_utility/include" ) diff --git a/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/esp_zb_switch.c b/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/esp_zb_switch.c index 5d2c416..4d48b48 100644 --- a/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/esp_zb_switch.c +++ b/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/esp_zb_switch.c @@ -173,6 +173,12 @@ static void esp_zb_task(void *pvParameters) esp_zb_init(&zb_nwk_cfg); esp_zb_on_off_switch_cfg_t switch_cfg = ESP_ZB_DEFAULT_ON_OFF_SWITCH_CONFIG(); esp_zb_ep_list_t *esp_zb_on_off_switch_ep = esp_zb_on_off_switch_ep_create(HA_ONOFF_SWITCH_ENDPOINT, &switch_cfg); + zcl_basic_manufacturer_info_t info = { + .manufacturer_name = ESP_MANUFACTURER_NAME, + .model_identifier = ESP_MODEL_IDENTIFIER, + }; + + esp_zcl_utility_add_ep_basic_manufacturer_info(esp_zb_on_off_switch_ep, HA_ONOFF_SWITCH_ENDPOINT, &info); esp_zb_device_register(esp_zb_on_off_switch_ep); esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK); ESP_ERROR_CHECK(esp_zb_start(false)); diff --git a/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/esp_zb_switch.h b/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/esp_zb_switch.h index 7a35302..705daea 100644 --- a/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/esp_zb_switch.h +++ b/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/esp_zb_switch.h @@ -13,6 +13,7 @@ */ #include "esp_zigbee_core.h" #include "switch_driver.h" +#include "zcl_utility.h" /* Zigbee configuration */ #define MAX_CHILDREN 10 /* the max amount of connected devices */ @@ -20,6 +21,10 @@ #define HA_ONOFF_SWITCH_ENDPOINT 1 /* esp light switch device endpoint */ #define ESP_ZB_PRIMARY_CHANNEL_MASK (1l << 13) /* Zigbee primary channel mask use in the example */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZC_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_COORDINATOR, \ diff --git a/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/idf_component.yml b/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/idf_component.yml index 55ab41e..067b6aa 100644 --- a/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/idf_component.yml +++ b/examples/esp_zigbee_HA_sample/HA_on_off_switch/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" ## Required IDF version idf: version: ">=5.0.0" diff --git a/examples/esp_zigbee_HA_sample/HA_temperature_sensor/main/esp_zb_temperature_sensor.h b/examples/esp_zigbee_HA_sample/HA_temperature_sensor/main/esp_zb_temperature_sensor.h index 66b95b5..c579b9a 100644 --- a/examples/esp_zigbee_HA_sample/HA_temperature_sensor/main/esp_zb_temperature_sensor.h +++ b/examples/esp_zigbee_HA_sample/HA_temperature_sensor/main/esp_zb_temperature_sensor.h @@ -28,8 +28,8 @@ /* Attribute values in ZCL string format * The string should be started with the length of its own. */ -#define MANUFACTURER_NAME "\x0B""ESPRESSIF" -#define MODEL_IDENTIFIER "\x09"CONFIG_IDF_TARGET +#define MANUFACTURER_NAME "\x09""ESPRESSIF" +#define MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET #define ESP_ZB_ZED_CONFIG() \ { \ diff --git a/examples/esp_zigbee_HA_sample/HA_temperature_sensor/main/idf_component.yml b/examples/esp_zigbee_HA_sample/HA_temperature_sensor/main/idf_component.yml index 55ab41e..067b6aa 100644 --- a/examples/esp_zigbee_HA_sample/HA_temperature_sensor/main/idf_component.yml +++ b/examples/esp_zigbee_HA_sample/HA_temperature_sensor/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" ## Required IDF version idf: version: ">=5.0.0" diff --git a/examples/esp_zigbee_HA_sample/HA_thermostat/main/esp_zb_thermostat.h b/examples/esp_zigbee_HA_sample/HA_thermostat/main/esp_zb_thermostat.h index 2b9fea4..de6f395 100644 --- a/examples/esp_zigbee_HA_sample/HA_thermostat/main/esp_zb_thermostat.h +++ b/examples/esp_zigbee_HA_sample/HA_thermostat/main/esp_zb_thermostat.h @@ -22,8 +22,8 @@ /* Attribute values in ZCL string format * The string should be started with the length of its own. */ -#define MANUFACTURER_NAME "\x0B""ESPRESSIF" -#define MODEL_IDENTIFIER "\x09"CONFIG_IDF_TARGET +#define MANUFACTURER_NAME "\x09""ESPRESSIF" +#define MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET #define ESP_ZB_ZC_CONFIG() \ { \ diff --git a/examples/esp_zigbee_HA_sample/HA_thermostat/main/idf_component.yml b/examples/esp_zigbee_HA_sample/HA_thermostat/main/idf_component.yml index 55ab41e..067b6aa 100644 --- a/examples/esp_zigbee_HA_sample/HA_thermostat/main/idf_component.yml +++ b/examples/esp_zigbee_HA_sample/HA_thermostat/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" ## Required IDF version idf: version: ">=5.0.0" diff --git a/examples/esp_zigbee_cli/main/idf_component.yml b/examples/esp_zigbee_cli/main/idf_component.yml index 55ab41e..067b6aa 100644 --- a/examples/esp_zigbee_cli/main/idf_component.yml +++ b/examples/esp_zigbee_cli/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" ## Required IDF version idf: version: ">=5.0.0" diff --git a/examples/esp_zigbee_customized_devices/customized_client/main/esp_HA_customized_switch.c b/examples/esp_zigbee_customized_devices/customized_client/main/esp_HA_customized_switch.c index 4a0c4d1..f97f1cc 100644 --- a/examples/esp_zigbee_customized_devices/customized_client/main/esp_HA_customized_switch.c +++ b/examples/esp_zigbee_customized_devices/customized_client/main/esp_HA_customized_switch.c @@ -299,6 +299,9 @@ static void esp_zb_task(void *pvParameters) test_attr = 0; /* basic cluster create with fully customized */ esp_zb_attribute_list_t *esp_zb_basic_cluster = esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_BASIC); + esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, ESP_MANUFACTURER_NAME); + esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID, ESP_MODEL_IDENTIFIER); + esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_ZCL_VERSION_ID, &test_attr); esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_POWER_SOURCE_ID, &test_attr); esp_zb_cluster_update_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_ZCL_VERSION_ID, &test_attr); diff --git a/examples/esp_zigbee_customized_devices/customized_client/main/esp_HA_customized_switch.h b/examples/esp_zigbee_customized_devices/customized_client/main/esp_HA_customized_switch.h index f9f50a0..1a6e6bc 100644 --- a/examples/esp_zigbee_customized_devices/customized_client/main/esp_HA_customized_switch.h +++ b/examples/esp_zigbee_customized_devices/customized_client/main/esp_HA_customized_switch.h @@ -23,6 +23,10 @@ #define ESP_ZB_PRIMARY_CHANNEL_MASK (1l << 11) /* Zigbee primary channel mask use in the example */ #define ESP_ZB_SECONDARY_CHANNEL_MASK (1l << 13) /* Zigbee primary channel mask use in the example */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZED_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_ED, \ diff --git a/examples/esp_zigbee_customized_devices/customized_client/main/idf_component.yml b/examples/esp_zigbee_customized_devices/customized_client/main/idf_component.yml index 55ab41e..067b6aa 100644 --- a/examples/esp_zigbee_customized_devices/customized_client/main/idf_component.yml +++ b/examples/esp_zigbee_customized_devices/customized_client/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" ## Required IDF version idf: version: ">=5.0.0" diff --git a/examples/esp_zigbee_customized_devices/customized_server/main/esp_HA_customized_light.c b/examples/esp_zigbee_customized_devices/customized_server/main/esp_HA_customized_light.c index 2e5b856..35e14f5 100644 --- a/examples/esp_zigbee_customized_devices/customized_server/main/esp_HA_customized_light.c +++ b/examples/esp_zigbee_customized_devices/customized_server/main/esp_HA_customized_light.c @@ -154,6 +154,8 @@ static void esp_zb_task(void *pvParameters) test_attr2 = 3; /* basic cluster create with fully customized */ esp_zb_attribute_list_t *esp_zb_basic_cluster = esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_BASIC); + esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, ESP_MANUFACTURER_NAME); + esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID, ESP_MODEL_IDENTIFIER); esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_ZCL_VERSION_ID, &test_attr); esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_POWER_SOURCE_ID, &test_attr); esp_zb_cluster_update_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_ZCL_VERSION_ID, &test_attr2); @@ -174,7 +176,8 @@ static void esp_zb_task(void *pvParameters) esp_zb_cluster_list_t *esp_zb_cluster_list = esp_zb_zcl_cluster_list_create(); esp_zb_cluster_list_add_basic_cluster(esp_zb_cluster_list, esp_zb_basic_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); /* update basic cluster in the existed cluster list */ - esp_zb_cluster_list_update_basic_cluster(esp_zb_cluster_list, esp_zb_basic_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + esp_zb_cluster_list_update_cluster(esp_zb_cluster_list, esp_zb_basic_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_ID_BASIC, + ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); esp_zb_cluster_list_add_identify_cluster(esp_zb_cluster_list, esp_zb_identify_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); esp_zb_cluster_list_add_groups_cluster(esp_zb_cluster_list, esp_zb_groups_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); esp_zb_cluster_list_add_scenes_cluster(esp_zb_cluster_list, esp_zb_scenes_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); diff --git a/examples/esp_zigbee_customized_devices/customized_server/main/esp_HA_customized_light.h b/examples/esp_zigbee_customized_devices/customized_server/main/esp_HA_customized_light.h index 7b01f71..ed66a4c 100644 --- a/examples/esp_zigbee_customized_devices/customized_server/main/esp_HA_customized_light.h +++ b/examples/esp_zigbee_customized_devices/customized_server/main/esp_HA_customized_light.h @@ -21,6 +21,10 @@ #define HA_ESP_LIGHT_ENDPOINT 10 /* esp light bulb device endpoint */ #define ESP_ZB_PRIMARY_CHANNEL_MASK (1l << 13) /* Zigbee primary channel mask use in the example */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZC_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_COORDINATOR, \ diff --git a/examples/esp_zigbee_customized_devices/customized_server/main/idf_component.yml b/examples/esp_zigbee_customized_devices/customized_server/main/idf_component.yml index ebc68a4..7d754da 100644 --- a/examples/esp_zigbee_customized_devices/customized_server/main/idf_component.yml +++ b/examples/esp_zigbee_customized_devices/customized_server/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" espressif/led_strip: "~2.0.0" ## Required IDF version idf: diff --git a/examples/esp_zigbee_gateway/main/esp_zigbee_gateway.c b/examples/esp_zigbee_gateway/main/esp_zigbee_gateway.c index 761a7c7..0df9496 100644 --- a/examples/esp_zigbee_gateway/main/esp_zigbee_gateway.c +++ b/examples/esp_zigbee_gateway/main/esp_zigbee_gateway.c @@ -21,6 +21,7 @@ #include "esp_vfs_eventfd.h" #include "esp_spiffs.h" #include "esp_wifi.h" +#include "esp_zigbee_type.h" #include "nvs_flash.h" #include "protocol_examples_common.h" #include "esp_rcp_update.h" @@ -234,6 +235,22 @@ static void esp_zb_task(void *pvParameters) ESP_ERROR_CHECK(check_ot_rcp_version()); #endif esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK); + esp_zb_ep_list_t *ep_list = esp_zb_ep_list_create(); + esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create(); + esp_zb_endpoint_config_t endpoint_config = { + .endpoint = ESP_ZB_GATEWAY_ENDPOINT, + .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, + .app_device_id = ESP_ZB_HA_REMOTE_CONTROL_DEVICE_ID, + .app_device_version = 0, + }; + + esp_zb_attribute_list_t *basic_cluser = esp_zb_basic_cluster_create(NULL); + esp_zb_basic_cluster_add_attr(basic_cluser, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, ESP_MANUFACTURER_NAME); + esp_zb_basic_cluster_add_attr(basic_cluser, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID, ESP_MODEL_IDENTIFIER); + esp_zb_cluster_list_add_basic_cluster(cluster_list, basic_cluser, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + esp_zb_ep_list_add_gateway_ep(ep_list, cluster_list, endpoint_config); + esp_zb_device_register(ep_list); ESP_ERROR_CHECK(esp_zb_start(false)); esp_zb_main_loop_iteration(); esp_rcp_update_deinit(); diff --git a/examples/esp_zigbee_gateway/main/esp_zigbee_gateway.h b/examples/esp_zigbee_gateway/main/esp_zigbee_gateway.h index a94893c..552b405 100644 --- a/examples/esp_zigbee_gateway/main/esp_zigbee_gateway.h +++ b/examples/esp_zigbee_gateway/main/esp_zigbee_gateway.h @@ -19,6 +19,7 @@ #define MAX_CHILDREN 10 /* the max amount of connected devices */ #define INSTALLCODE_POLICY_ENABLE false /* enable the install code policy for security */ #define ESP_ZB_PRIMARY_CHANNEL_MASK (1l << 13) /* Zigbee primary channel mask use in the example */ +#define ESP_ZB_GATEWAY_ENDPOINT 1 /* Gateway endpoint identifier */ #define APP_PROD_CFG_CURRENT_VERSION 0x0001 /* Production configuration version */ #define RCP_VERSION_MAX_SIZE 80 #define HOST_RESET_PIN_TO_RCP_RESET CONFIG_PIN_TO_RCP_RESET @@ -26,6 +27,10 @@ #define HOST_RX_PIN_TO_RCP_TX CONFIG_PIN_TO_RCP_TX #define HOST_TX_PIN_TO_RCP_RX CONFIG_PIN_TO_RCP_RX +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZC_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_COORDINATOR, \ diff --git a/examples/esp_zigbee_gateway/main/idf_component.yml b/examples/esp_zigbee_gateway/main/idf_component.yml index 5b77c39..c9b6a1c 100644 --- a/examples/esp_zigbee_gateway/main/idf_component.yml +++ b/examples/esp_zigbee_gateway/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" espressif/esp_rcp_update: "~0.3.0" espressif/esp-serial-flasher: "~0.0.4" ## Required IDF version diff --git a/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/CMakeLists.txt b/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/CMakeLists.txt index c194b2e..a0f0b9b 100644 --- a/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/CMakeLists.txt +++ b/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/CMakeLists.txt @@ -1,5 +1,4 @@ idf_component_register( - SRCS - "esp_zigbee_gpc.c" - INCLUDE_DIRS "." + SRC_DIRS "." "../../../common/zcl_utility/src" + INCLUDE_DIRS "." "../../../common/zcl_utility/include" ) diff --git a/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/esp_zigbee_gpc.c b/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/esp_zigbee_gpc.c index d8bc12e..de301d2 100644 --- a/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/esp_zigbee_gpc.c +++ b/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/esp_zigbee_gpc.c @@ -236,7 +236,13 @@ static void esp_zb_task(void *pvParameters) .app_device_id = ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID, .app_device_version = 0 }; + zcl_basic_manufacturer_info_t info = { + .manufacturer_name = ESP_MANUFACTURER_NAME, + .model_identifier = ESP_MODEL_IDENTIFIER, + }; + esp_zb_ep_list_add_ep(ep_list, esp_zb_on_off_light_clusters_create(&light_cfg), endpoint_config); + esp_zcl_utility_add_ep_basic_manufacturer_info(ep_list, HA_LIGHT_ENDPOINT, &info); esp_zb_device_register(ep_list); esp_zb_core_action_handler_register(zb_action_handler); diff --git a/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/esp_zigbee_gpc.h b/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/esp_zigbee_gpc.h index ea668a6..d2b43b7 100644 --- a/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/esp_zigbee_gpc.h +++ b/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/esp_zigbee_gpc.h @@ -15,6 +15,7 @@ #include "esp_zigbee_core.h" #include "light_driver.h" #include "switch_driver.h" +#include "zcl_utility.h" /* Zigbee configuration */ #define MAX_CHILDREN 10 /*!< The max amount of connected devices */ @@ -29,6 +30,10 @@ #define ESP_ZGP_GPBB_FUNCTIONALITY 0x9ac3f /*!< GPP functionality, refer to esp_zgp_gpp_functionality_t */ #define ESP_ZGP_ACTIVE_FUNCTIONALITY_ID 0xFFFFFF /*!< Active GP functionality */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + /* Zigbee coordinator configuration */ #define ESP_ZB_ZC_CONFIG() \ { \ diff --git a/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/idf_component.yml b/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/idf_component.yml index ebc68a4..7d754da 100644 --- a/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/idf_component.yml +++ b/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" espressif/led_strip: "~2.0.0" ## Required IDF version idf: diff --git a/examples/esp_zigbee_greenpower/esp_zigbee_gpd/main/idf_component.yml b/examples/esp_zigbee_greenpower/esp_zigbee_gpd/main/idf_component.yml index 55ab41e..067b6aa 100644 --- a/examples/esp_zigbee_greenpower/esp_zigbee_gpd/main/idf_component.yml +++ b/examples/esp_zigbee_greenpower/esp_zigbee_gpd/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" ## Required IDF version idf: version: ">=5.0.0" diff --git a/examples/esp_zigbee_ncp/main/idf_component.yml b/examples/esp_zigbee_ncp/main/idf_component.yml index 595945c..a562d2f 100644 --- a/examples/esp_zigbee_ncp/main/idf_component.yml +++ b/examples/esp_zigbee_ncp/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" espressif/esp-zigbee-ncp: version: "1.*" override_path: "../../../components/esp-zigbee-ncp" diff --git a/examples/esp_zigbee_ota/ota_client/main/esp_ota_client.c b/examples/esp_zigbee_ota/ota_client/main/esp_ota_client.c index 5057dc2..8bac553 100644 --- a/examples/esp_zigbee_ota/ota_client/main/esp_ota_client.c +++ b/examples/esp_zigbee_ota/ota_client/main/esp_ota_client.c @@ -17,6 +17,7 @@ #include "esp_log.h" #include "esp_ota_ops.h" #include "esp_timer.h" +#include "esp_zigbee_cluster.h" #include "nvs_flash.h" #include "esp_ota_client.h" @@ -130,6 +131,10 @@ static void esp_zb_task(void *pvParameters) /* initialize Zigbee stack with Zigbee end-device config */ esp_zb_cfg_t zb_nwk_cfg = ESP_ZB_ZED_CONFIG(); esp_zb_init(&zb_nwk_cfg); + + esp_zb_attribute_list_t *esp_zb_basic_cluster = esp_zb_basic_cluster_create(NULL); + esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, ESP_MANUFACTURER_NAME); + esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID, ESP_MODEL_IDENTIFIER); /** Create ota client cluster with attributes. * Manufacturer code, image type and file version should match with configured values for server. * If the client values do not match with configured values then it shall discard the command and @@ -151,6 +156,7 @@ static void esp_zb_task(void *pvParameters) esp_zb_ota_cluster_add_attr(esp_zb_ota_client_cluster, ESP_ZB_ZCL_ATTR_OTA_UPGRADE_CLIENT_DATA_ID, (void *)&variable_config); /* create cluster list with ota cluster */ esp_zb_cluster_list_t *esp_zb_cluster_list = esp_zb_zcl_cluster_list_create(); + esp_zb_cluster_list_add_basic_cluster(esp_zb_cluster_list, esp_zb_basic_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); esp_zb_cluster_list_add_ota_cluster(esp_zb_cluster_list, esp_zb_ota_client_cluster, ESP_ZB_ZCL_CLUSTER_CLIENT_ROLE); /* add created endpoint (cluster_list) to endpoint list */ esp_zb_ep_list_t *esp_zb_ep_list = esp_zb_ep_list_create(); diff --git a/examples/esp_zigbee_ota/ota_client/main/esp_ota_client.h b/examples/esp_zigbee_ota/ota_client/main/esp_ota_client.h index 83b8a7a..ad743ec 100644 --- a/examples/esp_zigbee_ota/ota_client/main/esp_ota_client.h +++ b/examples/esp_zigbee_ota/ota_client/main/esp_ota_client.h @@ -27,6 +27,10 @@ #define OTA_UPGRADE_MAX_DATA_SIZE 64 /* The parameter indicates the maximum data size of query block image */ #define ESP_ZB_PRIMARY_CHANNEL_MASK ESP_ZB_TRANSCEIVER_ALL_CHANNELS_MASK /* Zigbee primary channel mask use in the example */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZED_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_ED, \ diff --git a/examples/esp_zigbee_ota/ota_client/main/idf_component.yml b/examples/esp_zigbee_ota/ota_client/main/idf_component.yml index 55ab41e..067b6aa 100644 --- a/examples/esp_zigbee_ota/ota_client/main/idf_component.yml +++ b/examples/esp_zigbee_ota/ota_client/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" ## Required IDF version idf: version: ">=5.0.0" diff --git a/examples/esp_zigbee_ota/ota_server/main/esp_ota_server.c b/examples/esp_zigbee_ota/ota_server/main/esp_ota_server.c index 28f091b..a5ea71a 100644 --- a/examples/esp_zigbee_ota/ota_server/main/esp_ota_server.c +++ b/examples/esp_zigbee_ota/ota_server/main/esp_ota_server.c @@ -179,6 +179,10 @@ static void esp_zb_task(void *pvParameters) /* initialize Zigbee stack */ esp_zb_cfg_t zb_nwk_cfg = ESP_ZB_ZC_CONFIG(); esp_zb_init(&zb_nwk_cfg); + + esp_zb_attribute_list_t *esp_zb_basic_cluster = esp_zb_basic_cluster_create(NULL); + esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, ESP_MANUFACTURER_NAME); + esp_zb_basic_cluster_add_attr(esp_zb_basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID, ESP_MODEL_IDENTIFIER); /* create ota upgrade cluster with server parameters */ esp_zb_attribute_list_t *esp_zb_ota_cluster = esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_OTA_UPGRADE); esp_zb_zcl_ota_upgrade_server_variable_t variable = { @@ -189,6 +193,7 @@ static void esp_zb_task(void *pvParameters) esp_zb_ota_cluster_add_attr(esp_zb_ota_cluster, ESP_ZB_ZCL_ATTR_OTA_UPGRADE_SERVER_DATA_ID, (void *)&variable); /* create cluster lists with ota cluster */ esp_zb_cluster_list_t *esp_zb_cluster_list = esp_zb_zcl_cluster_list_create(); + esp_zb_cluster_list_add_basic_cluster(esp_zb_cluster_list, esp_zb_basic_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); esp_zb_cluster_list_add_ota_cluster(esp_zb_cluster_list, esp_zb_ota_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); esp_zb_ep_list_t *esp_zb_ep_list = esp_zb_ep_list_create(); /* add created endpoint (cluster_list) to endpoint list */ diff --git a/examples/esp_zigbee_ota/ota_server/main/esp_ota_server.h b/examples/esp_zigbee_ota/ota_server/main/esp_ota_server.h index 438b95f..f0019d4 100644 --- a/examples/esp_zigbee_ota/ota_server/main/esp_ota_server.h +++ b/examples/esp_zigbee_ota/ota_server/main/esp_ota_server.h @@ -34,6 +34,10 @@ extern const uint8_t ota_file_start[] asm("_binary_ota_file_bin_start"); /* ota_file corresponds to filename and bin corresponds to filetype */ extern const uint8_t ota_file_end[] asm("_binary_ota_file_bin_end"); /* ota_file corresponds to filename and bin corresponds to filetype */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZC_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_COORDINATOR, \ diff --git a/examples/esp_zigbee_ota/ota_server/main/idf_component.yml b/examples/esp_zigbee_ota/ota_server/main/idf_component.yml index 0df05ef..779bc1f 100644 --- a/examples/esp_zigbee_ota/ota_server/main/idf_component.yml +++ b/examples/esp_zigbee_ota/ota_server/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" ## Required IDF version idf: version: ">=5.0.0" \ No newline at end of file diff --git a/examples/esp_zigbee_sleep/deep_sleep/main/CMakeLists.txt b/examples/esp_zigbee_sleep/deep_sleep/main/CMakeLists.txt index 2d9fde8..15343ef 100644 --- a/examples/esp_zigbee_sleep/deep_sleep/main/CMakeLists.txt +++ b/examples/esp_zigbee_sleep/deep_sleep/main/CMakeLists.txt @@ -1,5 +1,4 @@ idf_component_register( - SRCS - "esp_zb_sleepy_end_device.c" - INCLUDE_DIRS "." + SRC_DIRS "." "../../../common/zcl_utility/src" + INCLUDE_DIRS "." "../../../common/zcl_utility/include" ) diff --git a/examples/esp_zigbee_sleep/deep_sleep/main/esp_zb_sleepy_end_device.c b/examples/esp_zigbee_sleep/deep_sleep/main/esp_zb_sleepy_end_device.c index a171062..e85f3c1 100644 --- a/examples/esp_zigbee_sleep/deep_sleep/main/esp_zb_sleepy_end_device.c +++ b/examples/esp_zigbee_sleep/deep_sleep/main/esp_zb_sleepy_end_device.c @@ -223,6 +223,12 @@ static void esp_zb_task(void *pvParameters) /* set the on-off light device config */ esp_zb_on_off_light_cfg_t light_cfg = ESP_ZB_DEFAULT_ON_OFF_LIGHT_CONFIG(); esp_zb_ep_list_t *esp_zb_on_off_light_ep = esp_zb_on_off_light_ep_create(HA_ESP_LIGHT_ENDPOINT, &light_cfg); + zcl_basic_manufacturer_info_t info = { + .manufacturer_name = ESP_MANUFACTURER_NAME, + .model_identifier = ESP_MODEL_IDENTIFIER, + }; + + esp_zcl_utility_add_ep_basic_manufacturer_info(esp_zb_on_off_light_ep, HA_ESP_LIGHT_ENDPOINT, &info); esp_zb_device_register(esp_zb_on_off_light_ep); esp_zb_core_action_handler_register(zb_action_handler); esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK); diff --git a/examples/esp_zigbee_sleep/deep_sleep/main/esp_zb_sleepy_end_device.h b/examples/esp_zigbee_sleep/deep_sleep/main/esp_zb_sleepy_end_device.h index 2f5814c..3147923 100644 --- a/examples/esp_zigbee_sleep/deep_sleep/main/esp_zb_sleepy_end_device.h +++ b/examples/esp_zigbee_sleep/deep_sleep/main/esp_zb_sleepy_end_device.h @@ -13,6 +13,7 @@ */ #include "esp_zigbee_core.h" +#include "zcl_utility.h" /* Zigbee configuration */ #define INSTALLCODE_POLICY_ENABLE false /* enable the install code policy for security */ @@ -21,6 +22,10 @@ #define HA_ESP_LIGHT_ENDPOINT 10 /* esp light bulb device endpoint, used to process light controlling commands */ #define ESP_ZB_PRIMARY_CHANNEL_MASK ESP_ZB_TRANSCEIVER_ALL_CHANNELS_MASK /* Zigbee primary channel mask use in the example */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZED_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_ED, \ diff --git a/examples/esp_zigbee_sleep/deep_sleep/main/idf_component.yml b/examples/esp_zigbee_sleep/deep_sleep/main/idf_component.yml index 2f5de7f..74ae0c3 100644 --- a/examples/esp_zigbee_sleep/deep_sleep/main/idf_component.yml +++ b/examples/esp_zigbee_sleep/deep_sleep/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" # Required IDF version idf: version: ">=5.0.0" diff --git a/examples/esp_zigbee_sleep/light_sleep/main/CMakeLists.txt b/examples/esp_zigbee_sleep/light_sleep/main/CMakeLists.txt index 2d9fde8..a0f0b9b 100644 --- a/examples/esp_zigbee_sleep/light_sleep/main/CMakeLists.txt +++ b/examples/esp_zigbee_sleep/light_sleep/main/CMakeLists.txt @@ -1,5 +1,4 @@ idf_component_register( - SRCS - "esp_zb_sleepy_end_device.c" - INCLUDE_DIRS "." + SRC_DIRS "." "../../../common/zcl_utility/src" + INCLUDE_DIRS "." "../../../common/zcl_utility/include" ) diff --git a/examples/esp_zigbee_sleep/light_sleep/main/esp_zb_sleepy_end_device.c b/examples/esp_zigbee_sleep/light_sleep/main/esp_zb_sleepy_end_device.c index 7165725..3e1c2b1 100644 --- a/examples/esp_zigbee_sleep/light_sleep/main/esp_zb_sleepy_end_device.c +++ b/examples/esp_zigbee_sleep/light_sleep/main/esp_zb_sleepy_end_device.c @@ -203,6 +203,12 @@ static void esp_zb_task(void *pvParameters) /* set the on-off light device config */ esp_zb_on_off_light_cfg_t light_cfg = ESP_ZB_DEFAULT_ON_OFF_LIGHT_CONFIG(); esp_zb_ep_list_t *esp_zb_on_off_light_ep = esp_zb_on_off_light_ep_create(HA_ESP_LIGHT_ENDPOINT, &light_cfg); + zcl_basic_manufacturer_info_t info = { + .manufacturer_name = ESP_MANUFACTURER_NAME, + .model_identifier = ESP_MODEL_IDENTIFIER, + }; + + esp_zcl_utility_add_ep_basic_manufacturer_info(esp_zb_on_off_light_ep, HA_ESP_LIGHT_ENDPOINT, &info); esp_zb_device_register(esp_zb_on_off_light_ep); esp_zb_core_action_handler_register(zb_action_handler); esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK); diff --git a/examples/esp_zigbee_sleep/light_sleep/main/esp_zb_sleepy_end_device.h b/examples/esp_zigbee_sleep/light_sleep/main/esp_zb_sleepy_end_device.h index 2f5814c..3147923 100644 --- a/examples/esp_zigbee_sleep/light_sleep/main/esp_zb_sleepy_end_device.h +++ b/examples/esp_zigbee_sleep/light_sleep/main/esp_zb_sleepy_end_device.h @@ -13,6 +13,7 @@ */ #include "esp_zigbee_core.h" +#include "zcl_utility.h" /* Zigbee configuration */ #define INSTALLCODE_POLICY_ENABLE false /* enable the install code policy for security */ @@ -21,6 +22,10 @@ #define HA_ESP_LIGHT_ENDPOINT 10 /* esp light bulb device endpoint, used to process light controlling commands */ #define ESP_ZB_PRIMARY_CHANNEL_MASK ESP_ZB_TRANSCEIVER_ALL_CHANNELS_MASK /* Zigbee primary channel mask use in the example */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZED_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_ED, \ diff --git a/examples/esp_zigbee_sleep/light_sleep/main/idf_component.yml b/examples/esp_zigbee_sleep/light_sleep/main/idf_component.yml index 2f5de7f..74ae0c3 100644 --- a/examples/esp_zigbee_sleep/light_sleep/main/idf_component.yml +++ b/examples/esp_zigbee_sleep/light_sleep/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" # Required IDF version idf: version: ">=5.0.0" diff --git a/examples/esp_zigbee_touchlink/touchlink_light/main/esp_touchlink_light.c b/examples/esp_zigbee_touchlink/touchlink_light/main/esp_touchlink_light.c index d5e1b40..41cb7c1 100644 --- a/examples/esp_zigbee_touchlink/touchlink_light/main/esp_touchlink_light.c +++ b/examples/esp_zigbee_touchlink/touchlink_light/main/esp_touchlink_light.c @@ -149,6 +149,10 @@ static void esp_zb_task(void *pvParameters) esp_zb_on_off_light_cfg_t light_cfg = ESP_ZB_DEFAULT_ON_OFF_LIGHT_CONFIG(); /* Create a standard HA on-off light cluster list */ esp_zb_cluster_list_t *cluster_list = esp_zb_on_off_light_clusters_create(&light_cfg); + esp_zb_attribute_list_t *basic_cluster = + esp_zb_cluster_list_get_cluster(cluster_list, ESP_ZB_ZCL_CLUSTER_ID_BASIC, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + ESP_ERROR_CHECK(esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, ESP_MANUFACTURER_NAME)); + ESP_ERROR_CHECK(esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID, ESP_MODEL_IDENTIFIER)); /* Add touchlink commissioning cluster */ esp_zb_cluster_list_add_touchlink_commissioning_cluster(cluster_list, touchlink_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); diff --git a/examples/esp_zigbee_touchlink/touchlink_light/main/esp_touchlink_light.h b/examples/esp_zigbee_touchlink/touchlink_light/main/esp_touchlink_light.h index d03e20b..3f8632c 100644 --- a/examples/esp_zigbee_touchlink/touchlink_light/main/esp_touchlink_light.h +++ b/examples/esp_zigbee_touchlink/touchlink_light/main/esp_touchlink_light.h @@ -24,6 +24,10 @@ #define ESP_ZB_TOUCHLINK_CHANNEL_MASK (1l << 11) /* Zigbee touchlink channel mask use in the example */ #define TOUCHLINK_TARGET_TIMEOUT 60 /* The timeout for the Touchlink target, measured in seconds */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZR_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_ROUTER, \ diff --git a/examples/esp_zigbee_touchlink/touchlink_light/main/idf_component.yml b/examples/esp_zigbee_touchlink/touchlink_light/main/idf_component.yml index ebc68a4..7d754da 100644 --- a/examples/esp_zigbee_touchlink/touchlink_light/main/idf_component.yml +++ b/examples/esp_zigbee_touchlink/touchlink_light/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" espressif/led_strip: "~2.0.0" ## Required IDF version idf: diff --git a/examples/esp_zigbee_touchlink/touchlink_switch/main/esp_touchlink_switch.c b/examples/esp_zigbee_touchlink/touchlink_switch/main/esp_touchlink_switch.c index aee57a7..d99a5b1 100644 --- a/examples/esp_zigbee_touchlink/touchlink_switch/main/esp_touchlink_switch.c +++ b/examples/esp_zigbee_touchlink/touchlink_switch/main/esp_touchlink_switch.c @@ -199,6 +199,11 @@ static void esp_zb_task(void *pvParameters) esp_zb_on_off_switch_cfg_t switch_cfg = ESP_ZB_DEFAULT_ON_OFF_SWITCH_CONFIG(); /* Create a standard HA on-off switch cluster list */ esp_zb_cluster_list_t *cluster_list = esp_zb_on_off_switch_clusters_create(&switch_cfg); + esp_zb_attribute_list_t *basic_cluster = + esp_zb_cluster_list_get_cluster(cluster_list, ESP_ZB_ZCL_CLUSTER_ID_BASIC, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE); + ESP_ERROR_CHECK(esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID, ESP_MANUFACTURER_NAME)); + ESP_ERROR_CHECK(esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID, ESP_MODEL_IDENTIFIER)); + /* Add touchlink commissioning cluster */ esp_zb_cluster_list_add_touchlink_commissioning_cluster(cluster_list, touchlink_cluster, ESP_ZB_ZCL_CLUSTER_CLIENT_ROLE); diff --git a/examples/esp_zigbee_touchlink/touchlink_switch/main/esp_touchlink_switch.h b/examples/esp_zigbee_touchlink/touchlink_switch/main/esp_touchlink_switch.h index e17dee0..b4bc132 100644 --- a/examples/esp_zigbee_touchlink/touchlink_switch/main/esp_touchlink_switch.h +++ b/examples/esp_zigbee_touchlink/touchlink_switch/main/esp_touchlink_switch.h @@ -25,6 +25,10 @@ #define ESP_ZB_TOUCHLINK_CHANNEL (11) /* Zigbee touchlink channel use in the example */ #define ESP_ZB_TOUCHLINK_CHANNEL_MASK (1 << ESP_ZB_TOUCHLINK_CHANNEL) /* Zigbee touchlink channel mask use in the example */ +/* Basic manufacturer information */ +#define ESP_MANUFACTURER_NAME "\x09""ESPRESSIF" /* Customized manufacturer name */ +#define ESP_MODEL_IDENTIFIER "\x07"CONFIG_IDF_TARGET /* Customized model identifier */ + #define ESP_ZB_ZED_CONFIG() \ { \ .esp_zb_role = ESP_ZB_DEVICE_TYPE_ED, \ diff --git a/examples/esp_zigbee_touchlink/touchlink_switch/main/idf_component.yml b/examples/esp_zigbee_touchlink/touchlink_switch/main/idf_component.yml index 55ab41e..067b6aa 100644 --- a/examples/esp_zigbee_touchlink/touchlink_switch/main/idf_component.yml +++ b/examples/esp_zigbee_touchlink/touchlink_switch/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~1.3.0" - espressif/esp-zigbee-lib: "~1.3.0" + espressif/esp-zboss-lib: "~1.4.0" + espressif/esp-zigbee-lib: "~1.4.0" ## Required IDF version idf: version: ">=5.0.0"