Removed zigbee endpoint in zigbee bridge example

This commit is contained in:
chendejin
2024-05-23 21:14:49 +08:00
parent 2fb2422c6f
commit d777bd96c8
3 changed files with 1 additions and 18 deletions
-15
View File
@@ -103,21 +103,6 @@ static void zboss_task(void *pvParameters)
/* initialize Zigbee stack with Zigbee coordinator config */
esp_zb_cfg_t zb_nwk_cfg = ESP_ZB_ZC_CONFIG();
esp_zb_init(&zb_nwk_cfg);
// TODO: Send Zigbee command without client data model (TZ-883)
/* add an onoff endpoint to send the Zigbee onoff command through esp_zb_zcl_on_off_cmd_req */
esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create();
esp_zb_cluster_list_add_on_off_cluster(cluster_list, esp_zb_on_off_cluster_create(NULL),
ESP_ZB_ZCL_CLUSTER_CLIENT_ROLE);
esp_zb_endpoint_config_t endpoint_config = {
.endpoint = ESP_BRIDGE_ON_OFF_ENDPOINT,
.app_profile_id = ESP_ZB_AF_HA_PROFILE_ID,
.app_device_id = ESP_ZB_HA_ON_OFF_OUTPUT_DEVICE_ID,
};
esp_zb_ep_list_t *endpoint_list = esp_zb_ep_list_create();
esp_zb_ep_list_add_ep(endpoint_list, cluster_list, endpoint_config);
esp_zb_device_register(endpoint_list);
/* initiate Zigbee Stack start without zb_send_no_autostart_signal auto-start */
esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK);
ESP_ERROR_CHECK(esp_zb_start(false));
-1
View File
@@ -15,7 +15,6 @@
#define MAX_CHILDREN 10 /* the max amount of connected devices */
#define INSTALLCODE_POLICY_ENABLE false /* enable the install code policy for security */
#define ESP_ZB_PRIMARY_CHANNEL_MASK (1l << 13) /* Zigbee primary channel mask use in the example */
#define ESP_BRIDGE_ON_OFF_ENDPOINT (2) /* esp onoff device endpoint, used to send onoff controlling commands */
#define ESP_ZB_ZC_CONFIG() \
{ \
@@ -13,7 +13,6 @@
#include <esp_matter.h>
#include <esp_matter_bridge.h>
#include <zigbee_bridge.h>
#include <app_zboss.h>
static const char *TAG = "zigbee_bridge";
@@ -61,7 +60,7 @@ esp_err_t zigbee_bridge_attribute_update(uint16_t endpoint_id, uint32_t cluster_
esp_zb_zcl_on_off_cmd_t cmd_req;
cmd_req.zcl_basic_cmd.dst_addr_u.addr_short = zigbee_device->dev_addr.zigbee_shortaddr;
cmd_req.zcl_basic_cmd.dst_endpoint = zigbee_device->dev_addr.zigbee_endpointid;
cmd_req.zcl_basic_cmd.src_endpoint = ESP_BRIDGE_ON_OFF_ENDPOINT;
cmd_req.zcl_basic_cmd.src_endpoint = esp_matter::endpoint::get_id(zigbee_device->dev->endpoint);
cmd_req.address_mode = ESP_ZB_APS_ADDR_MODE_16_ENDP_PRESENT;
cmd_req.on_off_cmd_id = val->val.b ? ESP_ZB_ZCL_CMD_ON_OFF_ON_ID : ESP_ZB_ZCL_CMD_ON_OFF_OFF_ID;
if (esp_zb_lock_acquire(portMAX_DELAY)) {