Skip to content

Commit

Permalink
esp-zboss: Provide zboss APIs to fix github issues(70cea8e)
Browse files Browse the repository at this point in the history
* add TC standard distributed and pre-configured key settings
* add TC link key exchange setting
* add zb tx power setting
* add destination endpoint to report callback
* enable write callback for custom cluster

Closes: #21
Closes: #22
Closes: #23
Closes: #24
Closes: #25
  • Loading branch information
xieqinan committed May 26, 2023
1 parent 2d8bd73 commit 3ee1c52
Show file tree
Hide file tree
Showing 34 changed files with 63 additions and 19 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.cache
compile_commands.json
*.swp

# ESP-IDF default build directory name
build
build/
Expand All @@ -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
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: "0.5.6"
version: "0.6.0"
description: esp-zigbee library component
url: https://github.com/espressif/esp-zigbee-sdk
dependencies:
Expand Down
17 changes: 15 additions & 2 deletions components/esp-zigbee-lib/include/esp_zigbee_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,16 @@ 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
* @param[in] value A pointer to the attribute data value
*
*/
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
*
Expand Down Expand Up @@ -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.
*
Expand Down
23 changes: 23 additions & 0 deletions components/esp-zigbee-lib/include/esp_zigbee_secur.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
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.
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion examples/esp_zigbee_cli/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion examples/esp_zigbee_gateway/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/esp_zigbee_ota/ota_client/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion examples/esp_zigbee_ota/ota_server/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion examples/esp_zigbee_rcp/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 3ee1c52

Please sign in to comment.