Skip to content

Commit

Permalink
esp-zigbee-sdk: release/v1.0.1(00d5cde0)
Browse files Browse the repository at this point in the history
* Update esp-zboss-lib to v1.0.1
* Support the effect of level control and on/off cluster
* Support to scan all touchlink channels
* Optimize the Zigbee OTA examples
* Update the Zigbee OTA README.md
* Fix the panid setting
* Fix the reading attribute of zcl timer cluster
* Increase the endpoint number in the ZCL group table from 4 to 32

Closes: #72
Closes: #100
  • Loading branch information
xieqinan committed Oct 23, 2023
1 parent 41c7f14 commit f1369f2
Show file tree
Hide file tree
Showing 25 changed files with 125 additions and 65 deletions.
18 changes: 18 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Espressif Zigbee SDK Release Notes

## 20-Oct-2023
1.0.1 version release of ESP-ZIGBEE-SDK

### Features
- Update esp-zboss-lib to v1.0.1
- Support the effect of level control and on/off cluster
- Support to scan all touchlink channels
- Optimize the Zigbee OTA examples
- Update the Zigbee OTA README.md
- Closes: https://github.com/espressif/esp-zigbee-sdk/issues/100
- Closes: https://github.com/espressif/esp-zigbee-sdk/issues/72

### Bug Fixes
- Fix the panid setting
- Fix the reading attribute of zcl timer cluster
- Increase the endpoint number in the ZCL group table from 4 to 32


## 10-Oct-2023
1.0.0 version release of ESP-ZIGBEE-SDK

Expand Down
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.0.0"
version: "1.0.1"
description: esp-zigbee library component
url: https://github.com/espressif/esp-zigbee-sdk
dependencies:
Expand Down
7 changes: 5 additions & 2 deletions components/esp-zigbee-lib/include/esp_zigbee_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ typedef enum esp_zb_core_action_callback_id_s {
ESP_ZB_CORE_SCENES_STORE_SCENE_CB_ID = 0x0001, /*!< Store scene, refer to esp_zb_zcl_store_scene_message_t */
ESP_ZB_CORE_SCENES_RECALL_SCENE_CB_ID = 0x0002, /*!< Recall scene, refer to esp_zb_zcl_recall_scene_message_t */
ESP_ZB_CORE_IAS_ZONE_ENROLL_RESPONSE_VALUE_CB_ID = 0x0003, /*!< IAS Zone enroll response, refer to esp_zb_zcl_ias_zone_enroll_response_message_t */
ESP_ZB_CORE_OTA_UPGRADE_VALUE_CB_ID = 0x0004, /*!< Upgrade OTA, refer to esp_zb_zcl_ota_update_message_t */
ESP_ZB_CORE_THERMOSTAT_VALUE_CB_ID = 0x0005, /*!< Thermostat value, refer to esp_zb_zcl_thermostat_value_message_t */
ESP_ZB_CORE_OTA_UPGRADE_VALUE_CB_ID = 0x0004, /*!< Upgrade OTA, refer to esp_zb_zcl_ota_upgrade_value_message_t */
ESP_ZB_CORE_OTA_UPGRADE_SRV_STATUS_CB_ID = 0x0005, /*!< OTA Server status, refer to esp_zb_zcl_ota_upgrade_server_status_message_t */
ESP_ZB_CORE_OTA_UPGRADE_SRV_QUERY_IMAGE_CB_ID = 0x0006, /*!< OTA Server query image, refer to esp_zb_zcl_ota_upgrade_server_query_image_message_t */
ESP_ZB_CORE_THERMOSTAT_VALUE_CB_ID = 0x0007, /*!< Thermostat value, refer to esp_zb_zcl_thermostat_value_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 reprot response, refer to esp_zb_zcl_cmd_config_report_resp_message_t */
Expand Down Expand Up @@ -392,6 +394,7 @@ uint16_t esp_zb_get_pan_id(void);
/**
* @brief Set the Zigbee network PAN ID.
*
* @note The PAN ID will be set from the network PIB to the IEEE802154 PIB
* @param[in] pan_id 16-bit Zigbee network PAN ID
*
*/
Expand Down
79 changes: 52 additions & 27 deletions components/esp-zigbee-lib/include/esp_zigbee_ota.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,25 @@
extern "C" {
#endif

#include "esp_err.h"
#include "esp_zigbee_type.h"
#include "zcl/esp_zigbee_zcl_common.h"

/**
* @brief The basic zcl information for OTA command
*
*/
typedef struct esp_zb_ota_zcl_information_s {
esp_zb_zcl_addr_t src_addr; /*!< The source address */
uint16_t dst_short_addr; /*!< The destination short address */
uint8_t src_endpoint; /*!< The source endpoint identifier */
uint8_t dst_endpoint; /*!< The destination endpoint identifier */
uint16_t cluster_id; /*!< The cluster identifier */
uint16_t profile_id; /*!< The profile identifier */
uint8_t command_id; /*!< The command identifier */
uint16_t manufacturer_specific; /*!< The manufacturer specific data */
} esp_zb_ota_zcl_information_t;

/**
* @brief The Zigbee ZCL OTA file header struct.
*
Expand All @@ -24,51 +40,60 @@ typedef struct esp_zb_ota_file_header_s {
} esp_zb_ota_file_header_t;

/**
* @brief The Zigbee ZCL OTA config struct for server initialize.
* @brief A callback for the OTA Server to retrieve the next OTA data
*
* @param[in] message The message will provide the basic OTA cluster information, @ref esp_zb_ota_zcl_information_s
* @param[in] index The index of the OTA file
* @param[in] size The size indicates how many bytes the user needs to allocate for the @p data
* @param[out] data The next OTA data that will be transmit to OTA Client by the OTA Server
*
*/
typedef struct esp_zb_ota_cfg_s {
uint8_t endpoint; /*!< Server endpoint */
uint32_t ota_upgrade_time; /*!< OTA Upgrade time */
esp_zb_ota_file_header_t ota_file_header; /*!< Config OTA file header */
uint8_t *ota_data; /*!< OTA app data */
} esp_zb_ota_cfg_t;

/********************* Declare functions **************************/
typedef esp_err_t (*esp_zb_ota_next_data_callback_t)(esp_zb_ota_zcl_information_t message, uint16_t index, uint8_t size, uint8_t **data);

/**
* @brief Config OTA server parameters
*
* @param[in] config pointer to the OTA upgrade parameter @ref esp_zb_ota_upgrade_server_parameter_s
* @brief The Zigbee ZCL OTA upgrade client variable configuration struct.
*
*/
void *esp_zb_ota_server_parameter(esp_zb_ota_upgrade_server_parameter_t *config);
typedef struct esp_zb_zcl_ota_upgrade_client_variable_s {
uint16_t timer_query; /*!< The field indicates the time of querying OTA imagge for OTA upgrade client */
uint16_t hw_version; /*!< The hardware version */
uint8_t max_data_size; /*!< The maxinum size of OTA data */
} esp_zb_zcl_ota_upgrade_client_variable_t;

/**
* @brief Initialize OTA Upgrade cluster - server part
*
* @param[in] esp_zb_ota_config pointer to the OTA config @ref esp_zb_ota_cfg_s
* @brief The Zigbee ZCL OTA upgrade server variable configuration struct.
*
*/
void esp_zb_ota_server_init(esp_zb_ota_cfg_t *esp_zb_ota_config);
typedef struct esp_zb_zcl_ota_upgrade_server_variable_s {
uint8_t query_jitter; /*!< Query jitter */
uint32_t current_time; /*!< Current time of OTA server */
uint8_t file_count; /*!< The field specifies the maximum number of OTA files for the OTA upgrade server variable. */
} esp_zb_zcl_ota_upgrade_server_variable_t;

/**
* @brief Start OTA server
*
* @note After initialization of server part to insert OTA file to upgrade mechanism
* @brief The Zigbee ZCL OTA upgrade server notification request struct
*
*/
void esp_zb_ota_server_start(void);
typedef struct esp_zb_ota_upgrade_server_notify_req_s {
uint8_t endpoint; /*!< The endpoint identifier for ota server cluster */
uint8_t index; /*!< The index of OTA file */
uint8_t notify_on; /*!< The field indicates whether send the notification request directly */
uint32_t ota_upgrade_time; /*!< The time indicates the interval for the OTA file upgrade after the OTA process is completed */
esp_zb_ota_file_header_t ota_file_header; /*!< The header is used to register the basic OTA upgrade information */
esp_zb_ota_next_data_callback_t next_data_cb; /*!< The callback is used to retrieve the next OTA data, which will be transmitted to the OTA client side */
} esp_zb_ota_upgrade_server_notify_req_t;

/********************* Declare functions **************************/
/**
* @brief Config OTA client parameters
*
* @param[in] config pointer to the OTA upgrade client parameter @ref esp_zb_ota_upgrade_client_parameter_s
*
* @note Currently set timer_counter to default value - to do first OTA request after 1 min
* @brief Notify the image upgrade event of OTA upgrade server
*
* @param[in] req The OTA file information request @ref esp_zb_ota_upgrade_server_notify_req_s
* @return
* - ESP_OK: On success
* - ESP_ERR_NOT_FOUND: Not found the variable table in the OTA server side
* - ESP_ERR_INVALID_ARG: The input arguments are incorrect or invalid.
*/
void *esp_zb_ota_client_parameter(esp_zb_ota_upgrade_client_parameter_t *config);
esp_err_t esp_zb_ota_upgrade_server_notify_req(esp_zb_ota_upgrade_server_notify_req_t *req);

#ifdef __cplusplus
}
Expand Down
21 changes: 0 additions & 21 deletions components/esp-zigbee-lib/include/esp_zigbee_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,27 +264,6 @@ typedef struct esp_zb_endpoint_s {
} ESP_ZB_PACKED_STRUCT
esp_zb_endpoint_t;

/**
* @brief The Zigbee ZCL OTA upgrade server parameter struct.
*
*/
typedef struct esp_zb_ota_upgrade_server_parameter_s {
uint8_t query_jitter; /*!< Query jitter */
uint32_t current_time; /*!< Current time of OTA server */
} esp_zb_ota_upgrade_server_parameter_t;

/**
* @brief The Zigbee ZCL OTA upgrade client parameter struct.
*
* @note Currently field control is set to bit mask 1, later will support the other bit mask
*
*/
typedef struct esp_zb_ota_upgrade_client_parameter_s {
uint16_t query_timer; /*!< Time interval for query next image request command */
uint16_t hardware_version; /*!< Version of hardware */
uint8_t max_data_size; /*!< Maximum data size of query block image */
} esp_zb_ota_upgrade_client_parameter_t;

/******************* attribute list *******************/
/**
* @brief The esp-zigbee data model of list of attribute.
Expand Down
44 changes: 36 additions & 8 deletions components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_command.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once
#include "esp_err.h"
#include "esp_zigbee_ota.h"
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -500,14 +501,12 @@ typedef struct esp_zb_zcl_groups_remove_all_groups_cmd_s {
*
* @note Get group membership will set enable ZCL response by default, later will support this feature
*
* @note Maximum group list size is 10.
*
*/
typedef struct esp_zb_zcl_groups_get_group_membership_cmd_s {
esp_zb_zcl_basic_cmd_t zcl_basic_cmd; /*!< Basic command info */
esp_zb_zcl_address_mode_t address_mode; /*!< APS addressing mode constants @ref esp_zb_zcl_address_mode_t */
uint8_t group_count; /*!< Total group count */
uint16_t group_list[10]; /*!< Maximum group list */
uint16_t *group_list; /*!< Maximum group list */
} esp_zb_zcl_groups_get_group_membership_cmd_t;

/**
Expand Down Expand Up @@ -798,13 +797,42 @@ typedef struct esp_zb_zcl_ias_zone_enroll_response_message_s {
} esp_zb_zcl_ias_zone_enroll_response_message_t;

/**
* @brief The Zigbee zcl ota upgrade device callback message struct
* @brief The Zigbee zcl ota upgrade value device callback message struct
*
*/
typedef struct esp_zb_zcl_ota_update_message_s {
esp_zb_device_cb_common_info_t info; /*!< The common information for Zigbee device callback */
esp_zb_zcl_ota_upgrade_status_t update_status; /*!< The update status for Zigbee ota update */
} esp_zb_zcl_ota_update_message_t;
typedef struct esp_zb_zcl_ota_upgrade_value_message_s {
esp_zb_device_cb_common_info_t info; /*!< The common information for Zigbee device callback */
esp_zb_zcl_ota_upgrade_status_t upgrade_status; /*!< The update status for Zigbee ota update */
esp_zb_ota_file_header_t ota_header; /*!< The header indiates the basic OTA upgrade information */
uint16_t payload_size; /*!< The OTA payload size */
uint8_t *payload; /*!< The OTA payload */
} esp_zb_zcl_ota_upgrade_value_message_t;

/**
* @brief The Zigbee zcl ota upgrade server status message struct
*
*/
typedef struct esp_zb_zcl_ota_upgrade_server_status_message_s {
esp_zb_device_cb_common_info_t info; /*!< The common information for Zigbee device callback */
esp_zb_zcl_addr_t zcl_addr; /*!< The address information is sourced from the OTA upgrade client */
esp_zb_ota_upgrade_server_status_t server_status; /*!< The status of OTA upgrade server, which can refer to esp_zb_ota_upgrade_server_status_t */
uint16_t image_type; /*!< The image type of OTA file */
uint32_t version; /*!< The version of OTA file */
uint32_t *upgrade_time; /*!< The upgrade time of OTA file, which indicates the interval time when the received OTA image will be updated */
} esp_zb_zcl_ota_upgrade_server_status_message_t;

/**
* @brief The Zigbee zcl ota upgrade server query image message struct
*
*/
typedef struct esp_zb_zcl_ota_upgrade_server_query_image_message_s {
esp_zb_device_cb_common_info_t info; /*!< The common information for Zigbee device callback */
esp_zb_zcl_addr_t zcl_addr; /*!< The address information is sourced from the OTA upgrade client */
uint16_t image_type; /*!< The image type of OTA file */
uint16_t manufacturer_code; /*!< The manufacturer code of OTA file */
uint32_t version; /*!< The version code of OTA file */
uint8_t *table_idx; /*!< The pointer for the index of variable table */
} esp_zb_zcl_ota_upgrade_server_query_image_message_t;

/**
* @brief The Zigbee zcl thermostat value callback message struct
Expand Down
11 changes: 9 additions & 2 deletions components/esp-zigbee-lib/include/zcl/esp_zigbee_zcl_ota.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ typedef enum {
/* Server variables and Custom data */
ESP_ZB_ZCL_ATTR_OTA_UPGRADE_SERVER_ENDPOINT_ID = 0xfff3, /*!< Brief OTA server endpoint custom attribute */
ESP_ZB_ZCL_ATTR_OTA_UPGRADE_SERVER_ADDR_ID = 0xfff2, /*!< Brief OTA server addr custom attribute */
ESP_ZB_ZCL_ATTR_OTA_UPGRADE_CLIENT_PARAMETER_ID = 0xfff1, /*!< Brief OTA client parameter attribute */
ESP_ZB_ZCL_ATTR_OTA_UPGRADE_SERVER_PARAMETER_ID = 0xfff0, /*!< Brief OTA server parameter attribute */
ESP_ZB_ZCL_ATTR_OTA_UPGRADE_CLIENT_DATA_ID = 0xfff1, /*!< Brief OTA client data attribute, its type can refer to esp_zb_zcl_ota_upgrade_client_variable_t */
ESP_ZB_ZCL_ATTR_OTA_UPGRADE_SERVER_DATA_ID = 0xfff0, /*!< Brief OTA server data attribute, its type can refer to esp_zb_zcl_ota_upgrade_server_variable_t */
} esp_zb_zcl_ota_upgrade_attr_t;

/** @brief Default value for UpgradeServerID attribute */
Expand Down Expand Up @@ -113,6 +113,13 @@ typedef enum {
ESP_ZB_ZCL_OTA_UPGRADE_STATUS_SERVER_NOT_FOUND = 0x000A /*!< Notify an application that OTA Upgrade server not found */
} esp_zb_zcl_ota_upgrade_status_t;

/** @brief The status of OTA upgrade server */
typedef enum {
ESP_ZB_ZCL_OTA_UPGRADE_SERVER_STARTED = 0x00, /*!< Start OTA */
ESP_ZB_ZCL_OTA_UPGRADE_SERVER_ABORTED = 0x01, /*!< Abort OTA */
ESP_ZB_ZCL_OTA_UPGRADE_SERVER_END = 0x02, /*!< End OTA */
} esp_zb_ota_upgrade_server_status_t;

#ifdef __cplusplus
}
#endif
Binary file modified components/esp-zigbee-lib/lib/esp32/libesp_zb_api_zczr.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32/libesp_zb_cli_command.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32c3/libesp_zb_api_zczr.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32c3/libesp_zb_cli_command.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_ed.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_rcp.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32c6/libesp_zb_api_zczr.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32c6/libesp_zb_cli_command.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_ed.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_rcp.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32h2/libesp_zb_api_zczr.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32h2/libesp_zb_cli_command.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32s2/libesp_zb_api_zczr.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32s2/libesp_zb_cli_command.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32s3/libesp_zb_api_zczr.a
Binary file not shown.
Binary file modified components/esp-zigbee-lib/lib/esp32s3/libesp_zb_cli_command.a
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/esp_zigbee_ota/ota_client/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
dependencies:
espressif/esp-zboss-lib: "~1.0.0"
espressif/esp-zigbee-lib: "~1.0.0"
espressif/esp-zboss-lib: "1.0.0"
espressif/esp-zigbee-lib: "1.0.0"
## Required IDF version
idf:
version: ">=5.0.0"
4 changes: 2 additions & 2 deletions examples/esp_zigbee_ota/ota_server/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
dependencies:
espressif/esp-zboss-lib: "~1.0.0"
espressif/esp-zigbee-lib: "~1.0.0"
espressif/esp-zboss-lib: "1.0.0"
espressif/esp-zigbee-lib: "1.0.0"
## Required IDF version
idf:
version: ">=5.0.0"

0 comments on commit f1369f2

Please sign in to comment.