diff --git a/.gitignore b/.gitignore index 4a00622..0169479 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .cache compile_commands.json *.swp + # ESP-IDF default build directory name build build/ @@ -12,9 +13,15 @@ managed_components __pycache__/ out/ _build/ + pytest_embedded_log/ # VS Code Settings .vscode/ + # clangd set .clangd compile_commands.json +.clang-format + +# pre-commit +.pre-commit-config.yaml diff --git a/components/esp-zigbee-lib/idf_component.yml b/components/esp-zigbee-lib/idf_component.yml index aa18677..07ab042 100644 --- a/components/esp-zigbee-lib/idf_component.yml +++ b/components/esp-zigbee-lib/idf_component.yml @@ -1,4 +1,4 @@ -version: "0.5.6" +version: "0.6.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_core.h b/components/esp-zigbee-lib/include/esp_zigbee_core.h index 0e96483..0af1eb6 100644 --- a/components/esp-zigbee-lib/include/esp_zigbee_core.h +++ b/components/esp-zigbee-lib/include/esp_zigbee_core.h @@ -71,7 +71,8 @@ typedef void (*esp_zb_set_attr_callback_t)(uint8_t status, uint8_t endpoint, uin * @brief A report attribute callback for user to get report info * * @param[in] addr A struct of address contains short and ieee address @ref esp_zb_zcl_addr_s - * @param[in] endpoint An endpoint which comes from report device + * @param[in] src_endpoint An endpoint which comes from report device + * @param[in] dst_endpoint Destination endpoint number * @param[in] cluster_id Cluster id that reported * @param[in] attr_id Attribute id that reported * @param[in] attr_type Attribute data type refer to esp_zb_zcl_attr_type_t @@ -79,7 +80,7 @@ typedef void (*esp_zb_set_attr_callback_t)(uint8_t status, uint8_t endpoint, uin * */ typedef void (*esp_zb_report_attr_callback_t)( - esp_zb_zcl_addr_t *addr, uint8_t endpoint, uint16_t cluster_id, uint16_t attr_id, esp_zb_zcl_attr_type_t attr_type, void *value); + esp_zb_zcl_addr_t *addr, uint8_t src_endpoint, uint8_t dst_endpoint, uint16_t cluster_id, uint16_t attr_id, esp_zb_zcl_attr_type_t attr_type, void *value); /** Read attribute response callback * @@ -327,6 +328,18 @@ void esp_zb_set_pan_id(uint16_t pan_id); */ uint8_t esp_zb_get_current_channel(void); +/** + * @brief Set the tx power. + * @param[in] power 8-bit of power value in dB + */ +void esp_zb_set_tx_power(int8_t power); + +/** + * @brief Get the tx power. + * @param[in] power 8-bit of power pointer value in dB + */ +void esp_zb_get_tx_power(int8_t *power); + /** * @brief Get the Zigbee network device type. * diff --git a/components/esp-zigbee-lib/include/esp_zigbee_secur.h b/components/esp-zigbee-lib/include/esp_zigbee_secur.h index e6db192..1870fff 100644 --- a/components/esp-zigbee-lib/include/esp_zigbee_secur.h +++ b/components/esp-zigbee-lib/include/esp_zigbee_secur.h @@ -109,6 +109,29 @@ esp_err_t esp_zb_secur_ic_remove_req(esp_zb_ieee_addr_t address); */ esp_err_t esp_zb_secur_ic_remove_all_req(void); +/** + * @brief Set the Trust Center standard distrbuted key + * + * @param key A pointer to standard distributed key of Trust Center that will be set to + */ + void esp_zb_secur_TC_standard_distributed_key_set(uint8_t *key); + +/** + * @brief Set the Trust Center pre-configured security key + * + * @param key A pointer to the pre-configured key of Trust Center that will be set to + */ +void esp_zb_secur_TC_standard_preconfigure_key_set(uint8_t *key); + +/** + * @brief Set the link key exchange requirement for a ZigBee node. + * + * @note The ZigBee end device with @p disabled will not request key from the ZigBee coordinator. + * The ZigBee coordinator with @p disabled allows the end device to stay in network without a TC-link key exchange. + * @param[in] enable Enable or Disable + */ +void esp_zb_secur_link_key_exchange_required_set(bool enable); + #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 0829e4f..4f3749f 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 @@ -66,8 +66,8 @@ typedef struct esp_zb_zcl_config_report_cmd_s { uint16_t clusterID; /*!< Cluster ID to report */ uint16_t attributeID; /*!< Attribute ID to report */ uint8_t attrType; /*!< Attribute type to report refer to zb_zcl_common.h zcl_attr_type */ - uint8_t min_interval; /*!< Minimum reporting interval */ - uint8_t max_interval; /*!< Maximum reporting interval */ + uint16_t min_interval; /*!< Minimum reporting interval */ + uint16_t max_interval; /*!< Maximum reporting interval */ uint16_t reportable_change; /*!< Minimum change to attribute will result in report */ } esp_zb_zcl_config_report_cmd_t; diff --git a/components/esp-zigbee-lib/include/zdo/esp_zigbee_zdo_common.h b/components/esp-zigbee-lib/include/zdo/esp_zigbee_zdo_common.h index 202be2c..71e72a6 100644 --- a/components/esp-zigbee-lib/include/zdo/esp_zigbee_zdo_common.h +++ b/components/esp-zigbee-lib/include/zdo/esp_zigbee_zdo_common.h @@ -101,7 +101,7 @@ typedef enum { * @note Stack passes this parameter to application when device leave the network. */ typedef struct esp_zb_zdo_signal_leave_params_s { - esp_zb_nwk_leave_type_t leave_type; /*!< Leave type. @ref nwk_leave_type */ + uint8_t leave_type; /*!< Leave type. @ref nwk_leave_type */ } esp_zb_zdo_signal_leave_params_t; /** 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 4dd6549..bdc70d5 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 93e4d64..f59b7e2 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 92185c5..a26a17e 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 247a081..3d6c1a0 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 4cdfc58..4d22783 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_rcp.a b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_rcp.a index d301518..e3bf5f0 100644 Binary files a/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_rcp.a and b/components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_rcp.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 06cdc66..0c02031 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 16b2de7..12dbe13 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 4cdfc58..4d22783 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_rcp.a b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_rcp.a index d301518..e3bf5f0 100644 Binary files a/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_rcp.a and b/components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_rcp.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 06cdc66..0c02031 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 16b2de7..12dbe13 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 4dd6549..bdc70d5 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 93e4d64..f59b7e2 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 4dd6549..bdc70d5 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 93e4d64..f59b7e2 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/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 cf482b1..23d4c0c 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,6 +1,6 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~0.4.0" + espressif/esp-zboss-lib: "~0.5.0" espressif/led_strip: "~2.0.0" ## Required IDF version idf: 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 c153176..bc73f2d 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,6 +1,6 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~0.4.0" + espressif/esp-zboss-lib: "~0.5.0" ## Required IDF version idf: version: ">=5.0.0" 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 cf482b1..23d4c0c 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,6 +1,6 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~0.4.0" + espressif/esp-zboss-lib: "~0.5.0" espressif/led_strip: "~2.0.0" ## Required IDF version idf: 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 c153176..bc73f2d 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,6 +1,6 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~0.4.0" + espressif/esp-zboss-lib: "~0.5.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 c153176..bc73f2d 100644 --- a/examples/esp_zigbee_cli/main/idf_component.yml +++ b/examples/esp_zigbee_cli/main/idf_component.yml @@ -1,6 +1,6 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~0.4.0" + espressif/esp-zboss-lib: "~0.5.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 a608b48..a8e28ab 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 @@ -170,10 +170,11 @@ static void user_find_cb(esp_zb_zdp_status_t zdo_status, uint16_t addr, uint8_t } } -static void esp_zb_dev_reporting_cb(esp_zb_zcl_addr_t *addr, uint8_t endpoint, uint16_t cluster_id, +static void esp_zb_dev_reporting_cb(esp_zb_zcl_addr_t *addr, uint8_t src_endpoint, uint8_t dst_endpoint, uint16_t cluster_id, uint16_t attr_id, esp_zb_zcl_attr_type_t attr_type, void *value) { - ESP_LOGI(TAG, "Switch got report attribute from address:0x%x,cluster_id:0x%x,attr_id:0x%x,value:%d,attr_type:0x%x,", addr->u.short_addr, cluster_id, attr_id, *(uint8_t *)value, attr_type); + ESP_LOGI(TAG, "Switch got report attribute from address:0x%x,src_ep:%d,dst_ep:%d,cluster_id:0x%x,attr_id:0x%x,value:%d,attr_type:0x%x,", addr->u.short_addr, src_endpoint, dst_endpoint, cluster_id, + attr_id, *(uint8_t *)value, attr_type); } static void esp_zb_read_resp_cb(esp_zb_zcl_status_t status, uint16_t cluster_id, uint16_t attr_id, esp_zb_zcl_attr_type_t attr_type, void *value) 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 c153176..bc73f2d 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,6 +1,6 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~0.4.0" + espressif/esp-zboss-lib: "~0.5.0" ## Required IDF version idf: version: ">=5.0.0" 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 cf482b1..23d4c0c 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,6 +1,6 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~0.4.0" + espressif/esp-zboss-lib: "~0.5.0" espressif/led_strip: "~2.0.0" ## Required IDF version idf: diff --git a/examples/esp_zigbee_gateway/main/idf_component.yml b/examples/esp_zigbee_gateway/main/idf_component.yml index 5fcef9b..663b981 100644 --- a/examples/esp_zigbee_gateway/main/idf_component.yml +++ b/examples/esp_zigbee_gateway/main/idf_component.yml @@ -1,6 +1,6 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~0.4.0" + espressif/esp-zboss-lib: "~0.5.0" espressif/esp_rcp_update: "~0.3.0" espressif/esp-serial-flasher: "~0.0.4" ## Required IDF version 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 c153176..bc73f2d 100644 --- a/examples/esp_zigbee_ota/ota_client/main/idf_component.yml +++ b/examples/esp_zigbee_ota/ota_client/main/idf_component.yml @@ -1,6 +1,6 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~0.4.0" + espressif/esp-zboss-lib: "~0.5.0" ## Required IDF version idf: version: ">=5.0.0" 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 99d37b0..6288e29 100644 --- a/examples/esp_zigbee_ota/ota_server/main/idf_component.yml +++ b/examples/esp_zigbee_ota/ota_server/main/idf_component.yml @@ -1,6 +1,6 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~0.4.0" + espressif/esp-zboss-lib: "~0.5.0" ## Required IDF version idf: version: ">=5.0.0" \ No newline at end of file diff --git a/examples/esp_zigbee_rcp/main/idf_component.yml b/examples/esp_zigbee_rcp/main/idf_component.yml index c153176..bc73f2d 100644 --- a/examples/esp_zigbee_rcp/main/idf_component.yml +++ b/examples/esp_zigbee_rcp/main/idf_component.yml @@ -1,6 +1,6 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp-zboss-lib: "~0.4.0" + espressif/esp-zboss-lib: "~0.5.0" ## Required IDF version idf: version: ">=5.0.0"