diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c9401ef..a7c0407 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,7 @@ before_script: .setup_idf: &setup_idf - cd $CI_PROJECT_DIR - - git clone --depth=1 -b $CI_COMMIT_REF_NAME ${IDF_GIT_REPO_URL} || git clone --depth=1 -b master ${IDF_GIT_REPO_URL} + - git clone --depth=1 -b $CI_COMMIT_REF_NAME ${IDF_GIT_REPO_URL} || git clone --depth=1 -b v5.1.3 ${IDF_GIT_REPO_URL} - cd esp-idf - ./install.sh - . ./export.sh @@ -62,7 +62,7 @@ before_script: build_non_pytest_examples: stage: build - image: ${CI_DOCKER_REGISTRY}/esp-env-v5.3:1 + image: ${CI_DOCKER_REGISTRY}/esp-env-v5.1:1 artifacts: paths: - "**/build*/*.bin" @@ -83,7 +83,7 @@ build_non_pytest_examples: build_non_pytest_host: stage: build - image: ${CI_DOCKER_REGISTRY}/esp-env-v5.3:1 + image: ${CI_DOCKER_REGISTRY}/esp-env-v5.1:1 artifacts: when: always expire_in: 4 days @@ -96,7 +96,7 @@ build_non_pytest_host: build_pytest_examples: stage: build - image: ${CI_DOCKER_REGISTRY}/esp-env-v5.3:1 + image: ${CI_DOCKER_REGISTRY}/esp-env-v5.1:1 artifacts: paths: - "**/build*/*.bin" @@ -117,7 +117,7 @@ build_pytest_examples: build_pytest_gateway: stage: build - image: ${CI_DOCKER_REGISTRY}/esp-env-v5.3:1 + image: ${CI_DOCKER_REGISTRY}/esp-env-v5.1:1 artifacts: paths: - "**/build*/*.bin" @@ -139,7 +139,7 @@ build_pytest_gateway: build_docs: stage: build - image: $CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.3:1-1 + image: $CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.1:1-1 variables: ESP_DOCS_LATEST_BRANCH_NAME: "main" artifacts: @@ -154,7 +154,7 @@ build_docs: pytest_esp32h2_i154_zigbee_multi_dut: stage: target_test - image: ${CI_DOCKER_REGISTRY}/target-test-env-v5.3:1 + image: ${CI_DOCKER_REGISTRY}/target-test-env-v5.1:1 needs: - build_pytest_examples script: @@ -164,7 +164,7 @@ pytest_esp32h2_i154_zigbee_multi_dut: pytest_esp32c6_i154_zigbee_multi_dut: stage: target_test - image: ${CI_DOCKER_REGISTRY}/target-test-env-v5.3:1 + image: ${CI_DOCKER_REGISTRY}/target-test-env-v5.1:1 needs: - build_pytest_examples script: @@ -174,7 +174,7 @@ pytest_esp32c6_i154_zigbee_multi_dut: pytest_esp32s3_i154_zigbee_multi_dut: stage: target_test - image: ${CI_DOCKER_REGISTRY}/target-test-env-v5.3:1 + image: ${CI_DOCKER_REGISTRY}/target-test-env-v5.1:1 needs: - build_pytest_gateway script: @@ -184,7 +184,7 @@ pytest_esp32s3_i154_zigbee_multi_dut: .deploy_docs_template: stage: docs - image: $CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.3:1-1 + image: $CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.1:1-1 needs: - build_docs variables: diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 41f6589..e7ee7d4 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,30 @@ # Espressif Zigbee SDK Release Notes +## 8-Mar-2024 +1.2.0 version release of ESP-ZIGBEE-SDK is based on esp-idf v5.1.3 + +### Features +- Updated esp-zboss-lib to v1.2.0 +- Updated esp-zigbee-lib to v1.2.0 +- Supported to report the level value at each step upon receiving the level change command +- Supported cli to configure green power functionality +- Supported to print assert location +- Supported 64-bit timer for stack +- Supported to configure the multiple pre-configured link key for centralized and distributed network +- Added more optional attributes support for color control + +### Bug Fixes +- Fixed the group membership response +- Fixed optional hue attribute for color control +- Fixed the parameters for esp_zb_ep_list_add_ep() +- Closes: https://github.com/espressif/esp-zigbee-sdk/issues/83 +- Closes: https://github.com/espressif/esp-zigbee-sdk/issues/251 +- Closes: https://github.com/espressif/esp-zigbee-sdk/issues/256 + +### Break Changes +- The `esp_zb_ep_list_add_ep()` function now utilizes an endpoint configuration structure,instead of multi parameters. + + ## 22-Feb-2024 1.1.2 version release of ESP-ZIGBEE-SDK diff --git a/components/esp-zigbee-lib/idf_component.yml b/components/esp-zigbee-lib/idf_component.yml index 53d1584..a45a911 100644 --- a/components/esp-zigbee-lib/idf_component.yml +++ b/components/esp-zigbee-lib/idf_component.yml @@ -1,4 +1,4 @@ -version: "1.1.2" +version: "1.2.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_endpoint.h b/components/esp-zigbee-lib/include/esp_zigbee_endpoint.h index bbdb12a..208d40e 100644 --- a/components/esp-zigbee-lib/include/esp_zigbee_endpoint.h +++ b/components/esp-zigbee-lib/include/esp_zigbee_endpoint.h @@ -25,16 +25,14 @@ esp_zb_ep_list_t *esp_zb_ep_list_create(void); * * @param[in] ep_list A pointer to endpoint list @ref esp_zb_ep_list_s * @param[in] cluster_list An cluster list which wants to add to endpoint - * @param[in] endpoint A specific endpoint (cluster list) - * @param[in] profile_id A profile id - * @param[in] device_id A device id for this device + * @param[in] endpoint_config A specific endpoint config @ref esp_zb_endpoint_config_s * @anchor esp_zb_ep_list_add_ep * @return * - ESP_OK on success * - ESP_ERR_INVALID_ARG if endpoint list not initialized * */ -esp_err_t esp_zb_ep_list_add_ep(esp_zb_ep_list_t *ep_list, esp_zb_cluster_list_t *cluster_list, uint8_t endpoint, uint16_t profile_id, uint16_t device_id); +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); #ifdef __cplusplus } diff --git a/components/esp-zigbee-lib/include/esp_zigbee_secur.h b/components/esp-zigbee-lib/include/esp_zigbee_secur.h index e20c996..44fbbfa 100644 --- a/components/esp-zigbee-lib/include/esp_zigbee_secur.h +++ b/components/esp-zigbee-lib/include/esp_zigbee_secur.h @@ -169,6 +169,46 @@ uint8_t esp_zb_secur_network_min_join_lqi_get(void); */ void esp_zb_secur_network_min_join_lqi_set(uint8_t lqi); +/** + * @brief Add the specified pre-configured TC standard link key for the device + * + * @param[in] key A pointer to 16-byte pre-configured link key to be set + * @return + * - ESP_OK: Preconfigured TC standard link key added successfully + * - ESP_FAIL: Failed to add preconfigured TC standard link key + */ +esp_err_t esp_zb_secur_multi_TC_standard_preconfigure_key_add(uint8_t *key); + +/** + * @brief Remove the specified pre-configured TC standard link key from the device + * + * @param[in] key A pointer to 16-byte the pre-configured link key to be removed + * @return + * - ESP_OK: Preconfigured TC standard link key removed successfully + * - ESP_FAIL: Failed to remove preconfigured TC standard link key + */ +esp_err_t esp_zb_secur_multi_TC_standard_preconfigure_key_remove(uint8_t *key); + +/** + * @brief Add the specified pre-configured distributed link key for the device + * + * @param[in] key A pointer to 16-byte pre-configured distributed link key to be set + * @return + * - ESP_OK: Preconfigured distributed link key added successfully + * - ESP_FAIL: Failed to add preconfigured distributed link key + */ +esp_err_t esp_zb_secur_multi_standard_distributed_key_add(uint8_t *key); + +/** + * @brief Remove the specified pre-configured distributed link key from the device + * + * @param[in] key A pointer to 16-byte pre-configured distributed link key to be removed + * @return + * - ESP_OK: Preconfigured distributed link key removed successfully + * - ESP_FAIL: Failed to remove preconfigured distributed link key + */ +esp_err_t esp_zb_secur_multi_standard_distributed_key_remove(uint8_t *key); + #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 de18705..3a97ff4 100644 --- a/components/esp-zigbee-lib/include/esp_zigbee_type.h +++ b/components/esp-zigbee-lib/include/esp_zigbee_type.h @@ -158,7 +158,7 @@ typedef struct esp_zb_zcl_reporting_info_s { uint8_t cluster_role; /*!< Cluster rolo server/client */ uint16_t attr_id; /*!< Attribute ID for reporting */ uint8_t flags; /*!< Flags to inform status of reporting */ - uint32_t run_time; /*!< Time to run next reporting activity */ + uint64_t run_time; /*!< Time to run next reporting activity */ union { struct { uint16_t min_interval; /*!< Actual minimum reporting interval */ @@ -233,14 +233,25 @@ typedef struct esp_zb_af_simple_desc_1_1_s { uint8_t endpoint; /*!< Endpoint */ uint16_t app_profile_id; /*!< Application profile identifier */ uint16_t app_device_id; /*!< Application device identifier */ - uint32_t app_device_version: 4; /*!< Application device version */ - uint32_t reserved: 4; /*!< Reserved */ + uint32_t app_device_version: 4; /*!< Application device version */ + uint32_t reserved: 4; /*!< Reserved */ uint8_t app_input_cluster_count; /*!< Application input cluster count */ uint8_t app_output_cluster_count; /*!< Application output cluster count */ uint16_t app_cluster_list[2]; /*!< Application input and output cluster list */ } ESP_ZB_PACKED_STRUCT esp_zb_af_simple_desc_1_1_t; +/** + * @brief Structure of device descriptor on a endpoint + */ +typedef struct esp_zb_endpoint_config_s { + uint8_t endpoint; /*!< Endpoint */ + uint16_t app_profile_id; /*!< Application profile identifier */ + uint16_t app_device_id; /*!< Application device identifier */ + uint32_t app_device_version: 4; /*!< Application device version */ +} ESP_ZB_PACKED_STRUCT +esp_zb_endpoint_config_t; + /** * @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 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 1bcd801..3300d2c 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_cli_command.a b/components/esp-zigbee-lib/lib/esp32/libesp_zb_cli_command.a index 1c590b9..d4568a3 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 3a2d6a4..f60b94a 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_cli_command.a b/components/esp-zigbee-lib/lib/esp32c3/libesp_zb_cli_command.a index 14e12f9..4b90f51 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 30aa49b..74e3684 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_gpd.a b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_gpd.a index 9f319d7..2fe30eb 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 0245b1e..1acb88f 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_cli_command.a b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_cli_command.a index c2856e0..f15fc7b 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 2aa3830..f144ecd 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_gpd.a b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_gpd.a index 847e6fe..5955e42 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 43b364a..ac68531 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_cli_command.a b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_cli_command.a index c2856e0..f15fc7b 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 1bcd801..3300d2c 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_cli_command.a b/components/esp-zigbee-lib/lib/esp32s2/libesp_zb_cli_command.a index 1c590b9..d4568a3 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 1bcd801..3300d2c 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_cli_command.a b/components/esp-zigbee-lib/lib/esp32s3/libesp_zb_cli_command.a index 1c590b9..d4568a3 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/components/esp-zigbee-ncp/src/esp_ncp_zb.c b/components/esp-zigbee-ncp/src/esp_ncp_zb.c index 7d2e29a..3019260 100644 --- a/components/esp-zigbee-ncp/src/esp_ncp_zb.c +++ b/components/esp-zigbee-ncp/src/esp_ncp_zb.c @@ -191,7 +191,7 @@ static void esp_ncp_zb_aps_data_confirm_handler(esp_zb_apsde_data_confirm_t conf static void esp_ncp_zb_bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee bdb commissioning"); } static void esp_ncp_zb_bind_cb(esp_zb_zdp_status_t zdo_status, void *user_ctx) @@ -554,7 +554,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) case ESP_ZB_ZDO_SIGNAL_DEFAULT_START: break; case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_ZDO_SIGNAL_DEVICE_ANNCE: @@ -1026,7 +1026,13 @@ static esp_err_t esp_ncp_zb_add_endpoint_fn(const uint8_t *input, uint16_t inlen } esp_zb_ep_list_t *esp_zb_ep_list = esp_zb_ep_list_create(); - esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, ncp_endpoint->endpoint, ncp_endpoint->profileId, ncp_endpoint->deviceId); + esp_zb_endpoint_config_t endpoint_config = { + .endpoint = ncp_endpoint->endpoint, + .app_profile_id = ncp_endpoint->profileId, + .app_device_id = ncp_endpoint->deviceId, + .app_device_version = 0 + }; + esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, endpoint_config); esp_zb_device_register(esp_zb_ep_list); if (inputClusterList) { 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 7a5f00a..c467ace 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 @@ -28,7 +28,7 @@ static const char *TAG = "ESP_ZB_COLOR_DIMM_LIGHT"; /********************* Define functions **************************/ static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee commissioning"); } void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) @@ -38,7 +38,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) esp_zb_app_signal_type_t sig_type = *p_sg_p; switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: 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 2ed48c0..4df0e1c 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.0" espressif/led_strip: "~2.0.0" ## Required IDF version idf: 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 f157249..ca6f20f 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 @@ -12,6 +12,7 @@ * CONDITIONS OF ANY KIND, either express or implied. */ +#include "esp_check.h" #include "string.h" #include "nvs_flash.h" #include "esp_log.h" @@ -60,16 +61,20 @@ static void esp_zb_buttons_handler(switch_func_pair_t *button_func_pair) cmd_color.transition_time = 0; cmd_color.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; cmd_color.zcl_basic_cmd.src_endpoint = HA_COLOR_DIMMABLE_SWITCH_ENDPOINT; - ESP_EARLY_LOGI(TAG, "Send command for moving light color to (0x%x, 0x%x)", refer_x, refer_y); + esp_zb_lock_acquire(portMAX_DELAY); esp_zb_zcl_color_move_to_color_cmd_req(&cmd_color); + esp_zb_lock_release(); + ESP_EARLY_LOGI(TAG, "Send command for moving light color to (0x%x, 0x%x)", refer_x, refer_y); } else { esp_zb_zcl_move_to_level_cmd_t cmd_level; cmd_level.zcl_basic_cmd.src_endpoint = HA_COLOR_DIMMABLE_SWITCH_ENDPOINT; cmd_level.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; cmd_level.level = level_value; cmd_level.transition_time = 0xffff; - ESP_EARLY_LOGI(TAG, "Send command for moving light to %d level", level_value); + esp_zb_lock_acquire(portMAX_DELAY); esp_zb_zcl_level_move_to_level_with_onoff_cmd_req(&cmd_level); + esp_zb_lock_release(); + ESP_EARLY_LOGI(TAG, "Send command for moving light to %d level", level_value); level_value += step; } press_count++; @@ -78,7 +83,7 @@ static void esp_zb_buttons_handler(switch_func_pair_t *button_func_pair) static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee bdb commissioning"); } static void bind_cb(esp_zb_zdp_status_t zdo_status, void *user_ctx) @@ -125,7 +130,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) esp_zb_zdo_signal_device_annce_params_t *dev_annce_params = NULL; switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: 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 a211f60..9574f77 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.0" ## Required IDF version idf: version: ">=5.0.0" 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 b19d517..805eee5 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 @@ -27,7 +27,7 @@ static const char *TAG = "ESP_ZB_ON_OFF_LIGHT"; /********************* Define functions **************************/ static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee commissioning"); } void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) @@ -37,7 +37,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) esp_zb_app_signal_type_t sig_type = *p_sg_p; switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: 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 2ed48c0..4df0e1c 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.0" espressif/led_strip: "~2.0.0" ## Required IDF version idf: 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 bd91d2f..cdb2c87 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 @@ -12,6 +12,7 @@ * CONDITIONS OF ANY KIND, either express or implied. */ +#include "esp_check.h" #include "string.h" #include "nvs_flash.h" #include "esp_log.h" @@ -43,14 +44,16 @@ static void esp_zb_buttons_handler(switch_func_pair_t *button_func_pair) cmd_req.zcl_basic_cmd.src_endpoint = HA_ONOFF_SWITCH_ENDPOINT; cmd_req.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; cmd_req.on_off_cmd_id = ESP_ZB_ZCL_CMD_ON_OFF_TOGGLE_ID; - ESP_EARLY_LOGI(TAG, "Send 'on_off toggle' command"); + esp_zb_lock_acquire(portMAX_DELAY); esp_zb_zcl_on_off_cmd_req(&cmd_req); + esp_zb_lock_release(); + ESP_EARLY_LOGI(TAG, "Send 'on_off toggle' command"); } } static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee bdb commissioning"); } static void bind_cb(esp_zb_zdp_status_t zdo_status, void *user_ctx) @@ -94,7 +97,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) esp_zb_zdo_signal_device_annce_params_t *dev_annce_params = NULL; switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: 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 a211f60..9574f77 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.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 a211f60..9574f77 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.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 cbc66c9..dd4b6ef 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 @@ -56,8 +56,10 @@ static void esp_zb_buttons_handler(switch_func_pair_t *button_func_pair) cmd_req.zcl_basic_cmd.src_endpoint = HA_ONOFF_SWITCH_ENDPOINT; cmd_req.address_mode = ESP_ZB_APS_ADDR_MODE_16_ENDP_PRESENT; cmd_req.on_off_cmd_id = ESP_ZB_ZCL_CMD_ON_OFF_TOGGLE_ID; - ESP_EARLY_LOGI(TAG, "Send 'on_off toggle' command to address(0x%x) endpoint(%d)", on_off_light.short_addr, on_off_light.endpoint); + esp_zb_lock_acquire(portMAX_DELAY); esp_zb_zcl_on_off_cmd_req(&cmd_req); + esp_zb_lock_release(); + ESP_EARLY_LOGI(TAG, "Send 'on_off toggle' command to address(0x%x) endpoint(%d)", on_off_light.short_addr, on_off_light.endpoint); } break; default: break; @@ -66,7 +68,7 @@ static void esp_zb_buttons_handler(switch_func_pair_t *button_func_pair) static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee bdb commissioning"); } static void bind_cb(esp_zb_zdp_status_t zdo_status, void *user_ctx) @@ -306,7 +308,13 @@ static void esp_zb_task(void *pvParameters) esp_zb_cluster_list_add_identify_cluster(esp_zb_cluster_list, esp_zb_identify_client_cluster, ESP_ZB_ZCL_CLUSTER_CLIENT_ROLE); esp_zb_ep_list_t *esp_zb_ep_list = esp_zb_ep_list_create(); - esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, HA_ONOFF_SWITCH_ENDPOINT, ESP_ZB_AF_HA_PROFILE_ID, ESP_ZB_HA_ON_OFF_SWITCH_DEVICE_ID); + esp_zb_endpoint_config_t endpoint_config = { + .endpoint = HA_ONOFF_SWITCH_ENDPOINT, + .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, + .app_device_id = ESP_ZB_HA_ON_OFF_SWITCH_DEVICE_ID, + .app_device_version = 0 + }; + esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, endpoint_config); esp_zb_device_register(esp_zb_ep_list); 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_customized_devices/customized_client/main/idf_component.yml b/examples/esp_zigbee_customized_devices/customized_client/main/idf_component.yml index a211f60..9574f77 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.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 022ce12..faeaa73 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 @@ -24,7 +24,7 @@ static const char *TAG = "ESP_HA_ON_OFF_LIGHT"; static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee bdb commissioning"); } void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) @@ -36,7 +36,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) esp_zb_zdo_signal_leave_indication_params_t *leave_ind_params = NULL; switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: @@ -175,7 +175,13 @@ static void esp_zb_task(void *pvParameters) esp_zb_ep_list_t *esp_zb_ep_list = esp_zb_ep_list_create(); /* add created endpoint (cluster_list) to endpoint list */ - esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, HA_ESP_LIGHT_ENDPOINT, ESP_ZB_AF_HA_PROFILE_ID, ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID); + esp_zb_endpoint_config_t endpoint_config = { + .endpoint = HA_ESP_LIGHT_ENDPOINT, + .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, + .app_device_id = ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID, + .app_device_version = 0 + }; + esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, endpoint_config); esp_zb_device_register(esp_zb_ep_list); 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_customized_devices/customized_server/main/idf_component.yml b/examples/esp_zigbee_customized_devices/customized_server/main/idf_component.yml index 2ed48c0..4df0e1c 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.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 078d3f8..acb91be 100644 --- a/examples/esp_zigbee_gateway/main/esp_zigbee_gateway.c +++ b/examples/esp_zigbee_gateway/main/esp_zigbee_gateway.c @@ -104,7 +104,7 @@ static esp_err_t init_spiffs(void) static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee bdb commissioning"); } void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) @@ -117,15 +117,15 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: #if CONFIG_EXAMPLE_CONNECT_WIFI - ESP_ERROR_CHECK(example_connect()); + ESP_RETURN_ON_FALSE(example_connect() == ESP_OK, , TAG, "Failed to connect to Wi-Fi"); #if CONFIG_ESP_COEX_SW_COEXIST_ENABLE - ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_MIN_MODEM)); - esp_coex_wifi_i154_enable(); + ESP_RETURN_ON_FALSE(esp_wifi_set_ps(WIFI_PS_MIN_MODEM) == ESP_OK, , TAG, "Failed to set Wi-Fi minimum modem power save type"); + esp_coex_wifi_i154_enable(); #else - ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_NONE)); + ESP_RETURN_ON_FALSE(esp_wifi_set_ps(WIFI_PS_NONE) == ESP_OK, , TAG, "Failed to set Wi-Fi no power save type"); #endif #endif - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: diff --git a/examples/esp_zigbee_gateway/main/idf_component.yml b/examples/esp_zigbee_gateway/main/idf_component.yml index ed24d34..b03656b 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.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/esp_zigbee_gpc.c b/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/esp_zigbee_gpc.c index 0226fef..8fb4012 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 @@ -54,14 +54,18 @@ static void esp_zb_buttons_handler(switch_func_pair_t *button_func_pair) { switch (button_func_pair->func) { case SWITCH_ONOFF_TOGGLE_CONTROL: { - ESP_EARLY_LOGI(TAG, "Enter commissioning mode"); + esp_zb_lock_acquire(portMAX_DELAY); esp_zb_zgps_start_commissioning_on_endpoint(HA_LIGHT_ENDPOINT, 0); + esp_zb_lock_release(); + ESP_EARLY_LOGI(TAG, "Enter commissioning mode"); #if !ZGP_COMBO_PROXY_ENABLED esp_zgp_zcl_proxy_commissioning_enter_req_t cmd_req; cmd_req.exit_mode = ESP_ZGP_COMMISSIONING_EXIT_MODE_ON_PAIRING_SUCCESS; cmd_req.commissioning_window = 180; - ESP_EARLY_LOGI(TAG, "Send commissioning mode to ZGP proxy"); + esp_zb_lock_acquire(portMAX_DELAY); esp_zgp_zcl_proxy_commissioning_mode_enter_cmd_req(&cmd_req); + esp_zb_lock_release(); + ESP_EARLY_LOGI(TAG, "Send commissioning mode to ZGP proxy"); #endif } break; default: @@ -71,7 +75,7 @@ static void esp_zb_buttons_handler(switch_func_pair_t *button_func_pair) static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee bdb commissioning"); } void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) @@ -82,7 +86,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) esp_zb_zdo_signal_device_annce_params_t *dev_annce_params = NULL; switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: @@ -217,8 +221,13 @@ static void esp_zb_task(void *pvParameters) esp_zb_ep_list_t *ep_list = esp_zb_ep_list_create(); esp_zb_on_off_light_cfg_t light_cfg = ESP_ZB_DEFAULT_ON_OFF_LIGHT_CONFIG(); - esp_zb_ep_list_add_ep(ep_list, esp_zb_on_off_light_clusters_create(&light_cfg), HA_LIGHT_ENDPOINT, ESP_ZB_AF_HA_PROFILE_ID, - ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID); + esp_zb_endpoint_config_t endpoint_config = { + .endpoint = HA_LIGHT_ENDPOINT, + .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, + .app_device_id = ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID, + .app_device_version = 0 + }; + esp_zb_ep_list_add_ep(ep_list, esp_zb_on_off_light_clusters_create(&light_cfg), endpoint_config); 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/idf_component.yml b/examples/esp_zigbee_greenpower/esp_zigbee_gpc/main/idf_component.yml index 2ed48c0..4df0e1c 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.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 a211f60..9574f77 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.0" ## Required IDF version idf: version: ">=5.0.0" diff --git a/examples/esp_zigbee_host/main/esp_zb_host.c b/examples/esp_zigbee_host/main/esp_zb_host.c index da34ee5..a8d5278 100644 --- a/examples/esp_zigbee_host/main/esp_zb_host.c +++ b/examples/esp_zigbee_host/main/esp_zb_host.c @@ -12,6 +12,7 @@ * CONDITIONS OF ANY KIND, either express or implied. */ +#include "esp_check.h" #include "string.h" #include "nvs_flash.h" #include "esp_log.h" @@ -47,7 +48,7 @@ static void esp_zb_buttons_handler(switch_func_pair_t *button_func_pair) static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee bdb commissioning"); } static void bind_cb(esp_zb_zdp_status_t zdo_status, void *user_ctx) @@ -91,7 +92,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) esp_zb_zdo_signal_device_annce_params_t *dev_annce_params = NULL; switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: diff --git a/examples/esp_zigbee_ncp/main/idf_component.yml b/examples/esp_zigbee_ncp/main/idf_component.yml index 7f9cdf3..b4b3c07 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.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 c313efa..5057dc2 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 @@ -27,7 +27,7 @@ static esp_ota_handle_t s_ota_handle = 0; static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee commissioning"); } void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) @@ -154,7 +154,13 @@ static void esp_zb_task(void *pvParameters) 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(); - esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, ESP_OTA_CLIENT_ENDPOINT, ESP_ZB_AF_HA_PROFILE_ID, ESP_ZB_HA_TEST_DEVICE_ID); + esp_zb_endpoint_config_t endpoint_config = { + .endpoint = ESP_OTA_CLIENT_ENDPOINT, + .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, + .app_device_id = ESP_ZB_HA_TEST_DEVICE_ID, + .app_device_version = 0 + }; + esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, endpoint_config); esp_zb_device_register(esp_zb_ep_list); 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_ota/ota_client/main/idf_component.yml b/examples/esp_zigbee_ota/ota_client/main/idf_component.yml index a211f60..9574f77 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.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 8011591..28f091b 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 @@ -23,7 +23,7 @@ static esp_err_t zb_ota_next_data_handler(esp_zb_ota_zcl_information_t message, static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee commissioning"); } void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) @@ -34,7 +34,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) esp_zb_zdo_signal_device_annce_params_t *dev_annce_params = NULL; switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: @@ -192,7 +192,13 @@ static void esp_zb_task(void *pvParameters) 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 */ - esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, ESP_OTA_SERVER_ENDPOINT, ESP_ZB_AF_HA_PROFILE_ID, ESP_ZB_HA_TEST_DEVICE_ID); + esp_zb_endpoint_config_t endpoint_config = { + .endpoint = ESP_OTA_SERVER_ENDPOINT, + .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, + .app_device_id = ESP_ZB_HA_TEST_DEVICE_ID, + .app_device_version = 0 + }; + esp_zb_ep_list_add_ep(esp_zb_ep_list, esp_zb_cluster_list, endpoint_config); esp_zb_device_register(esp_zb_ep_list); esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK); esp_zb_core_action_handler_register(zb_action_handler); 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 43b6bf6..1d1b566 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.0" ## Required IDF version idf: version: ">=5.0.0" \ No newline at end of file diff --git a/examples/esp_zigbee_sleep/deep_sleep/README.md b/examples/esp_zigbee_sleep/deep_sleep/README.md index 1c757a4..ecb508f 100644 --- a/examples/esp_zigbee_sleep/deep_sleep/README.md +++ b/examples/esp_zigbee_sleep/deep_sleep/README.md @@ -71,12 +71,12 @@ I (249) ESP_ZB_DEEP_SLEEP: Enabling timer wakeup, 20s I (269) phy: phy_version: 211,0, 5857fe5, Nov 1 2023, 11:31:09 I (269) phy: libbtbb version: ce629d6, Nov 1 2023, 11:31:19 I (279) main_task: Returned from app_main() -I (289) ESP_ZB_DEEP_SLEEP: ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL -I (289) ESP_ZB_DEEP_SLEEP: Zigbee stack initialized -I (8749) ESP_ZB_DEEP_SLEEP: Start network steering -I (8849) ESP_ZB_DEEP_SLEEP: Joined network successfully (Extended PAN ID: 60:55:f9:ff:fe:f7:2f:3e, PAN ID: 0xe4c4, Channel:13, Short Address: 0x5e1c) -I (8849) ESP_ZB_DEEP_SLEEP: Start one-shot timer for 5s to enter the deep sleep -I (13859) ESP_ZB_DEEP_SLEEP: Enter deep sleep +I (307) ESP_ZB_DEEP_SLEEP: ZDO signal: ZDO Config Ready (0x17), status: ESP_FAIL +I (307) ESP_ZB_DEEP_SLEEP: Zigbee stack initialized +I (587) ESP_ZB_DEEP_SLEEP: Device started up in non factory-reset mode +I (587) ESP_ZB_DEEP_SLEEP: Device rebooted +I (587) ESP_ZB_DEEP_SLEEP: Start one-shot timer for 5s to enter the deep sleep +I (5597) ESP_ZB_DEEP_SLEEP: Enter deep sleep ``` During the deep sleep, a typical power consumption is shown below: 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 49e47df..a171062 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 @@ -104,7 +104,7 @@ static void zb_deep_sleep_init(void) const uint64_t gpio_wakeup_pin_mask = 1ULL << gpio_wakeup_pin; /* The configuration mode depends on your hardware design. Since the BOOT button is connected to a pull-up resistor, the wake-up mode is configured as LOW. */ - ESP_ERROR_CHECK(esp_sleep_enable_ext1_wakeup_io(gpio_wakeup_pin_mask, ESP_EXT1_WAKEUP_ANY_LOW)); + ESP_ERROR_CHECK(esp_sleep_enable_ext1_wakeup(gpio_wakeup_pin_mask, ESP_EXT1_WAKEUP_ANY_LOW)); /* Also these two GPIO configurations are also depended on the hardware design. The BOOT button is connected to the pull-up resistor, so enable the pull-up mode and disable the pull-down mode. @@ -116,9 +116,17 @@ static void zb_deep_sleep_init(void) ESP_ERROR_CHECK(gpio_pulldown_dis(gpio_wakeup_pin)); } +static void zb_deep_sleep_start(void) +{ + /* Start the one-shot timer */ + const int before_deep_sleep_time_sec = 5; + ESP_LOGI(TAG, "Start one-shot timer for %ds to enter the deep sleep", before_deep_sleep_time_sec); + ESP_ERROR_CHECK(esp_timer_start_once(s_oneshot_timer, before_deep_sleep_time_sec * 1000000)); +} + static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee bdb commissioning"); } void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) @@ -128,7 +136,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) esp_zb_app_signal_type_t sig_type = *p_sg_p; switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: @@ -139,9 +147,9 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) ESP_LOGI(TAG, "Start network steering"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_NETWORK_STEERING); } else { + zb_deep_sleep_start(); ESP_LOGI(TAG, "Device rebooted"); } - } else { /* commissioning failed */ ESP_LOGW(TAG, "Failed to initialize Zigbee stack (status: %d)", err_status); @@ -152,15 +160,12 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) if (err_status == ESP_OK) { esp_zb_ieee_addr_t extended_pan_id; esp_zb_get_extended_pan_id(extended_pan_id); - ESP_LOGI(TAG, "Joined network successfully (Extended PAN ID: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x, PAN ID: 0x%04hx, Channel:%d, Short Address: 0x%04hx)", - extended_pan_id[7], extended_pan_id[6], extended_pan_id[5], extended_pan_id[4], - extended_pan_id[3], extended_pan_id[2], extended_pan_id[1], extended_pan_id[0], - esp_zb_get_pan_id(), esp_zb_get_current_channel(), esp_zb_get_short_address()); - - /* Start the one-shot timer */ - const int before_deep_sleep_time_sec = 5; - ESP_LOGI(TAG, "Start one-shot timer for %ds to enter the deep sleep", before_deep_sleep_time_sec); - ESP_ERROR_CHECK(esp_timer_start_once(s_oneshot_timer, before_deep_sleep_time_sec * 1000000)); + ESP_LOGI(TAG, + "Joined network successfully (Extended PAN ID: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x, PAN ID: 0x%04hx, Channel:%d, Short " + "Address: 0x%04hx)", + extended_pan_id[7], extended_pan_id[6], extended_pan_id[5], extended_pan_id[4], extended_pan_id[3], extended_pan_id[2], + extended_pan_id[1], extended_pan_id[0], esp_zb_get_pan_id(), esp_zb_get_current_channel(), esp_zb_get_short_address()); + zb_deep_sleep_start(); } else { ESP_LOGI(TAG, "Network steering was not successful (status: %d)", err_status); esp_zb_scheduler_alarm((esp_zb_callback_t)bdb_start_top_level_commissioning_cb, ESP_ZB_BDB_MODE_NETWORK_STEERING, 1000); 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 c68c360..99a6a65 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.0" # Required IDF version idf: version: ">=5.0.0" 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 22453ba..25769e2 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 @@ -33,7 +33,7 @@ static const char *TAG = "ESP_ZB_SLEEP"; /********************* Define functions **************************/ static void bdb_start_top_level_commissioning_cb(uint8_t mode_mask) { - ESP_ERROR_CHECK(esp_zb_bdb_start_top_level_commissioning(mode_mask)); + ESP_RETURN_ON_FALSE(esp_zb_bdb_start_top_level_commissioning(mode_mask) == ESP_OK, , TAG, "Failed to start Zigbee bdb commissioning"); } void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) @@ -43,7 +43,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) esp_zb_app_signal_type_t sig_type = *p_sg_p; switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: 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 c68c360..99a6a65 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.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 44276bf..dae7982 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 @@ -35,7 +35,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) esp_zb_zdo_signal_device_annce_params_t *dev_annce_params = NULL; switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: @@ -144,7 +144,13 @@ static void esp_zb_task(void *pvParameters) esp_zb_ep_list_t *esp_zb_ep_list = esp_zb_ep_list_create(); /* Add created endpoint (cluster_list) to endpoint list */ - esp_zb_ep_list_add_ep(esp_zb_ep_list, cluster_list, HA_ESP_LIGHT_ENDPOINT, ESP_ZB_AF_HA_PROFILE_ID, ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID); + esp_zb_endpoint_config_t endpoint_config = { + .endpoint = HA_ESP_LIGHT_ENDPOINT, + .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, + .app_device_id = ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID, + .app_device_version = 0 + }; + esp_zb_ep_list_add_ep(esp_zb_ep_list, cluster_list, endpoint_config); esp_zb_device_register(esp_zb_ep_list); esp_zb_core_action_handler_register(zb_action_handler); 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 2ed48c0..4df0e1c 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.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 cf6c8d5..ac12337 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 @@ -62,8 +62,10 @@ static void esp_zb_buttons_handler(switch_func_pair_t *button_func_pair) cmd_req.zcl_basic_cmd.src_endpoint = HA_ONOFF_SWITCH_ENDPOINT; cmd_req.address_mode = ESP_ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT; cmd_req.on_off_cmd_id = ESP_ZB_ZCL_CMD_ON_OFF_TOGGLE_ID; - ESP_EARLY_LOGI(TAG, "send 'on_off toggle' command"); + esp_zb_lock_acquire(portMAX_DELAY); esp_zb_zcl_on_off_cmd_req(&cmd_req); + esp_zb_lock_release(); + ESP_EARLY_LOGI(TAG, "send 'on_off toggle' command"); break; default: break; @@ -126,7 +128,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) switch (sig_type) { case ESP_ZB_ZDO_SIGNAL_SKIP_STARTUP: - ESP_LOGI(TAG, "Zigbee stack initialized"); + ESP_LOGI(TAG, "Initialize Zigbee stack"); esp_zb_bdb_start_top_level_commissioning(ESP_ZB_BDB_MODE_INITIALIZATION); break; case ESP_ZB_BDB_SIGNAL_DEVICE_FIRST_START: @@ -189,7 +191,13 @@ static void esp_zb_task(void *pvParameters) esp_zb_ep_list_t *esp_zb_ep_list = esp_zb_ep_list_create(); /* Add created endpoint (cluster_list) to endpoint list */ - esp_zb_ep_list_add_ep(esp_zb_ep_list, cluster_list, HA_ONOFF_SWITCH_ENDPOINT, ESP_ZB_AF_HA_PROFILE_ID, ESP_ZB_HA_ON_OFF_SWITCH_DEVICE_ID); + esp_zb_endpoint_config_t endpoint_config = { + .endpoint = HA_ONOFF_SWITCH_ENDPOINT, + .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, + .app_device_id = ESP_ZB_HA_ON_OFF_SWITCH_DEVICE_ID, + .app_device_version = 0 + }; + esp_zb_ep_list_add_ep(esp_zb_ep_list, cluster_list, endpoint_config); esp_zb_device_register(esp_zb_ep_list); ESP_ERROR_CHECK(esp_zb_start(false)); 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 a211f60..9574f77 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.1.0" - espressif/esp-zigbee-lib: "~1.1.0" + espressif/esp-zboss-lib: "~1.2.0" + espressif/esp-zigbee-lib: "~1.2.0" ## Required IDF version idf: version: ">=5.0.0" diff --git a/tools/ci/build_apps.py b/tools/ci/build_apps.py index 0ffa68f..b458892 100644 --- a/tools/ci/build_apps.py +++ b/tools/ci/build_apps.py @@ -139,6 +139,20 @@ def update_component_yml_files(): os.chdir(os.path.join(DEF_APP_PATH, 'esp_zigbee_sleep', 'light_sleep')) os.remove('main/idf_component.yml') + os.chdir(os.path.join(DEF_APP_PATH, 'esp_zigbee_greenpower', 'esp_zigbee_gpc')) + os.remove('main/idf_component.yml') + os.system( + f'cp {os.path.join(PROJECT_ROOT, "tools", "managed_component_yml", "light_idf_component.yml")} main' + f'/idf_component.yml') + + os.chdir(os.path.join(DEF_APP_PATH, 'esp_zigbee_greenpower', 'esp_zigbee_gpd')) + os.remove('main/idf_component.yml') + + os.chdir(os.path.join(DEF_APP_PATH, 'esp_zigbee_ncp')) + os.remove('main/idf_component.yml') + os.system( + f'cp {os.path.join(PROJECT_ROOT, "tools", "managed_component_yml", "ncp_idf_component.yml")} main' + f'/idf_component.yml') def main(args: argparse.Namespace) -> None: current_dir = os.getcwd() diff --git a/tools/managed_component_yml/ncp_idf_component.yml b/tools/managed_component_yml/ncp_idf_component.yml new file mode 100644 index 0000000..b02f71d --- /dev/null +++ b/tools/managed_component_yml/ncp_idf_component.yml @@ -0,0 +1,8 @@ +## IDF Component Manager Manifest File +dependencies: + espressif/esp-zigbee-ncp: + version: "1.*" + override_path: "../../../components/esp-zigbee-ncp" + ## Required IDF version + idf: + version: ">=5.0.0" \ No newline at end of file