Skip to content

Commit

Permalink
Merge branch 'release/esp-zigbee-sdk-v1.2.2' into 'main'
Browse files Browse the repository at this point in the history
esp-zigbee-sdk: release/v1.2.2(0533cd4e)

See merge request espressif/esp-zigbee-sdk!119
  • Loading branch information
chshu committed Apr 1, 2024
2 parents 84ff760 + 3128a1d commit fa2cd30
Show file tree
Hide file tree
Showing 45 changed files with 2,374 additions and 18 deletions.
32 changes: 32 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Espressif Zigbee SDK Release Notes

## 29-Mar-2024
1.2.2 version release of ESP-ZIGBEE-SDK is based on esp-idf v5.1.3

### Features
- Updated esp-zboss-lib to v1.2.2
- Updated esp-zigbee-lib to v1.2.2
- Added diagnostics cluster support
- Added meter_identification cluster support
- Added price cluster support
- Added Zigbee network size setting API
- Added Zigbee I/O buffer size setting API
- Added Zigbee binding table size setting API
- Added ZB_DEBUG_MODE option for optimizing the code size of release version library
- Removed ESP_ZB_TRACE_ENABLE option

### Bug Fixes
- Fixed profile id for zcl commands
- Fixed moving value for color control handler
- Fixed reuse issue with endpoint, cluster, and attribute lists
- Fixed issue with Zigbee sleep not waking up via GPIO
- Closes: https://github.com/espressif/esp-zigbee-sdk/issues/99
- Closes: https://github.com/espressif/esp-zigbee-sdk/issues/269
- Closes: https://github.com/espressif/esp-zigbee-sdk/issues/282
- Closes: https://github.com/espressif/esp-zigbee-sdk/issues/284
- Closes: https://github.com/espressif/esp-zigbee-sdk/issues/285

### Note
- The default network size is set to 64, please use the `esp_zb_overall_network_size_set()` to configure it.
- The default I/O buffer size is set to 80, please use the `esp_zb_io_buffer_size_set()` to configure it.
- The default binging table size is changed to 16, please use the API `esp_zb_aps_src_binding_table_size_set()` and `esp_zb_aps_dst_binding_table_size_set()` to configure it.


## 15-Mar-2024
1.2.1 version release of ESP-ZIGBEE-SDK is based on esp-idf v5.1.3

Expand Down
12 changes: 10 additions & 2 deletions components/esp-zigbee-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ if(CONFIG_ZB_ENABLED)
set(ESP_ZIGBEE_API_LIBS "")

if(CONFIG_ZB_ZCZR)
add_prebuilt_library(esp_zigbee_api_lib "${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}/libesp_zb_api_zczr.a" REQUIRES espressif__esp-zboss-lib)
if(CONFIG_ZB_DEBUG_MODE)
add_prebuilt_library(esp_zigbee_api_lib "${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}/libesp_zb_api_zczr.debug.a" REQUIRES espressif__esp-zboss-lib)
else()
add_prebuilt_library(esp_zigbee_api_lib "${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}/libesp_zb_api_zczr.a" REQUIRES espressif__esp-zboss-lib)
endif()
elseif(CONFIG_ZB_ZED)
add_prebuilt_library(esp_zigbee_api_lib "${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}/libesp_zb_api_ed.a" REQUIRES espressif__esp-zboss-lib)
if(CONFIG_ZB_DEBUG_MODE)
add_prebuilt_library(esp_zigbee_api_lib "${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}/libesp_zb_api_ed.debug.a" REQUIRES espressif__esp-zboss-lib)
else()
add_prebuilt_library(esp_zigbee_api_lib "${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}/libesp_zb_api_ed.a" REQUIRES espressif__esp-zboss-lib)
endif()
elseif(CONFIG_ZB_ZGPD)
add_prebuilt_library(esp_zigbee_api_lib "${CMAKE_CURRENT_SOURCE_DIR}/lib/${idf_target}/libesp_zb_api_gpd.a" REQUIRES espressif__esp-zboss-lib)
endif()
Expand Down
72 changes: 72 additions & 0 deletions components/esp-zigbee-lib/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
menu "Zigbee"

config ZB_ENABLED
bool "Zigbee Enable"
default n
help
Select this option to enable Zigbee and show the submenu with Zigbee configuration choices.

choice ZB_DEVICE_TYPE
prompt "Configure the Zigbee device type"
depends on ZB_ENABLED
default ZB_ZCZR
help
Configure the Zigbee device type

config ZB_ZCZR
bool "Zigbee Coordinator or Router device"
help
Select this to enable Zigbee Coordinator or Router.

config ZB_ZED
bool "Zigbee End Device"
help
Select this to enable Zigbee End Device.

config ZB_ZGPD
depends on SOC_IEEE802154_SUPPORTED
bool "Zigbee Green power device"
help
Select this to enable Zigbee Green Power Device.

endchoice

choice ZB_RADIO_TYPE
prompt "Configure the Zigbee radio type"
depends on ZB_ENABLED
default ZB_RADIO_NATIVE if SOC_IEEE802154_SUPPORTED
default ZB_RADIO_SPINEL_UART

config ZB_RADIO_NATIVE
bool "Native 15.4 radio"
help
Select this to use the native 15.4 radio.

config ZB_RADIO_SPINEL_UART
bool "Connect to 15.4 radio via Radio Spinel UART"
select OPENTHREAD_SPINEL_ONLY
help
Select this to connect to a Radio Co-Processor via Spinel UART.
endchoice

menu "Zigbee Example"
depends on ZB_ENABLED

config ZB_GP_ENABLED
depends on (ZB_ZCZR || ZB_ZGPD) && SOC_IEEE802154_SUPPORTED
bool "Zigbee Green Power enable"
default y if ZB_ZCZR
help
when enable green power, example would support as green power proxy(zczr default enabled), green power combo or just green power device.

endmenu

config ZB_DEBUG_MODE
depends on ZB_ENABLED

bool "Zigbee Debug Mode"
default n
help
Setting Zigbee stack debug mode.

endmenu
2 changes: 1 addition & 1 deletion components/esp-zigbee-lib/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.2.1"
version: "1.2.2"
description: esp-zigbee library component
url: https://github.com/espressif/esp-zigbee-sdk
dependencies:
Expand Down
28 changes: 28 additions & 0 deletions components/esp-zigbee-lib/include/esp_zigbee_attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,34 @@ esp_err_t esp_zb_pm2_5_measurement_cluster_add_attr(esp_zb_attribute_list_t *att
*/
esp_err_t esp_zb_multistate_value_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);

/**
* @brief Add an attribute in diagnostics 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_diagnostics_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);

/**
* @brief Add an attribute in meter identification 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_meter_identification_cluster_add_attr(esp_zb_attribute_list_t *attr_list, uint16_t attr_id, void *value_p);

/**
* @brief Add an attribute in a specified cluster.
*
Expand Down
110 changes: 110 additions & 0 deletions components/esp-zigbee-lib/include/esp_zigbee_cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,32 @@ esp_zb_attribute_list_t *esp_zb_multistate_value_cluster_create(esp_zb_multistat
*/
esp_zb_attribute_list_t *esp_zb_metering_cluster_create(esp_zb_metering_cluster_cfg_t *metering_cfg);

/**
* @brief Create a standard diagnostics attribute list
*
* @return pointer to attribute list @ref esp_zb_attribute_list_s
*
*/
esp_zb_attribute_list_t *esp_zb_diagnostics_cluster_create(void);

/**
* @brief Create a standard metering attribute list
*
* @param[in] meter_identification_cfg Configuration parameters for this cluster defined by @ref esp_zb_meter_identification_cluster_cfg_s
*
* @return pointer to attribute list @ref esp_zb_attribute_list_s
*
*/
esp_zb_attribute_list_t *esp_zb_meter_identification_cluster_create(esp_zb_meter_identification_cluster_cfg_t *meter_identification_cfg);

/**
* @brief Create a standard metering attribute list
*
* @return pointer to attribute list @ref esp_zb_attribute_list_s
*
*/
esp_zb_attribute_list_t *esp_zb_price_cluster_create(void);

/**************************************** ADD CLUSTER ***********************************/
/**
* @brief Add basic cluster (attribute list) in a cluster list.
Expand Down Expand Up @@ -849,6 +875,48 @@ esp_err_t esp_zb_cluster_list_add_multistate_value_cluster(esp_zb_cluster_list_t
*/
esp_err_t esp_zb_cluster_list_add_metering_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask);

/**
* @brief Add diagnostics 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_diagnostics_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask);

/**
* @brief Add meter identification 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_meter_identification_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask);

/**
* @brief Add price 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_price_cluster(esp_zb_cluster_list_t *cluster_list, esp_zb_attribute_list_t *attr_list, uint8_t role_mask);

/**
* @brief Add customized cluster (attribute list) in a cluster list.
*
Expand Down Expand Up @@ -1300,6 +1368,48 @@ esp_err_t esp_zb_cluster_list_update_multistate_value_cluster(esp_zb_cluster_lis
*/
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.
*
* @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_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.
*
* @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_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.
*
* @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_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.
*
Expand Down
52 changes: 52 additions & 0 deletions components/esp-zigbee-lib/include/esp_zigbee_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ typedef enum esp_zb_core_action_callback_id_s {
ESP_ZB_CORE_DOOR_LOCK_LOCK_DOOR_RESP_CB_ID = 0x0011, /*!< Lock/unlock door response, refer to esp_zb_zcl_door_lock_lock_door_resp_message_t */
ESP_ZB_CORE_IDENTIFY_EFFECT_CB_ID = 0x0012, /*!< Identify triggers effect request, refer to esp_zb_zcl_identify_effect_message_t */
ESP_ZB_CORE_BASIC_RESET_TO_FACTORY_RESET_CB_ID = 0x0013, /*!< Reset all clusters of endpoint to factory default, refer to esp_zb_zcl_basic_reset_factory_default_message_t */
ESP_ZB_CORE_PRICE_GET_CURRENT_PRICE_CB_ID = 0x0014, /*!< Price get current price, refer to esp_zb_zcl_price_get_current_price_message_t */
ESP_ZB_CORE_PRICE_GET_SCHEDULED_PRICES_CB_ID = 0x0015, /*!< Price get scheduled prices, refer to esp_zb_zcl_price_get_scheduled_prices_message_t */
ESP_ZB_CORE_PRICE_GET_TIER_LABELS_CB_ID = 0x0016, /*!< Price get tier labels, refer to esp_zb_zcl_price_get_tier_labels_message_t */
ESP_ZB_CORE_PRICE_PUBLISH_PRICE_CB_ID = 0x0017, /*!< Price publish price, refer to esp_zb_zcl_price_publish_price_message_t */
ESP_ZB_CORE_PRICE_PUBLISH_TIER_LABELS_CB_ID = 0x0018, /*!< Price publish tier labels, refer to esp_zb_zcl_price_publish_tier_labels_message_t */
ESP_ZB_CORE_PRICE_PRICE_ACK_CB_ID = 0x0019, /*!< Price price acknowledgement, refer to esp_zb_zcl_price_ack_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 */
Expand Down Expand Up @@ -323,6 +329,51 @@ void esp_zb_zcl_scenes_table_show(uint8_t endpoint);
*/
esp_err_t esp_zb_zcl_scenes_table_clear_by_index(uint16_t index);

/**
* @brief Set the maximum number of devices in a Zigbee network
*
* @note The function will only take effect when called before esp_zb_init(), it determins
* several table size such as the neighbor table and routing table, 64 by default
* @param[in] size The overall network size is expected to be set
* @return
* - ESP_OK: on success
* - ESP_FAIL: on failure
*/
esp_err_t esp_zb_overall_network_size_set(uint16_t size);

/**
* @brief Set Zigbee stack I/O buffer size
*
* @note The function will only take effect when called before esp_zb_init(), 80 by default.
* @param[in] size The I/O buffer size is expected to be set
* @return
* - ESP_OK: on success
* - ESP_FAIL: on failure
*/
esp_err_t esp_zb_io_buffer_size_set(uint16_t size);

/**
* @brief Set APS source binding table size
*
* @note The function will only take effect when called before esp_zb_init(), 16 by default
* @param[in] size The source binding table size is expected to be set
* @return
* - ESP_OK: on success
* - ESP_FAIL: on failure
*/
esp_err_t esp_zb_aps_src_binding_table_size_set(uint16_t size);

/**
* @brief Set APS destination binding table size
*
* @note The function will only take effect when called before esp_zb_init(), 16 by default
* @param[in] size The destination binding table size is expected to be set
* @return
* - ESP_OK: on success
* - ESP_FAIL: on failure
*/
esp_err_t esp_zb_aps_dst_binding_table_size_set(uint16_t size);

/**
* @brief Zigbee stack initialization.
*
Expand Down Expand Up @@ -758,6 +809,7 @@ 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
*
* @return
Expand Down
Loading

0 comments on commit fa2cd30

Please sign in to comment.