Skip to content

Commit be9a300

Browse files
committed
Merge branch 'example/zigbee_bridge_remove_endpoint' into 'main'
Removed zigbee endpoint in zigbee bridge example See merge request app-frameworks/esp-matter!752
2 parents 779b3f7 + d777bd9 commit be9a300

File tree

3 files changed

+1
-18
lines changed

3 files changed

+1
-18
lines changed

examples/zigbee_bridge/main/app_zboss.cpp

-15
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,6 @@ static void zboss_task(void *pvParameters)
103103
/* initialize Zigbee stack with Zigbee coordinator config */
104104
esp_zb_cfg_t zb_nwk_cfg = ESP_ZB_ZC_CONFIG();
105105
esp_zb_init(&zb_nwk_cfg);
106-
107-
// TODO: Send Zigbee command without client data model (TZ-883)
108-
/* add an onoff endpoint to send the Zigbee onoff command through esp_zb_zcl_on_off_cmd_req */
109-
esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create();
110-
esp_zb_cluster_list_add_on_off_cluster(cluster_list, esp_zb_on_off_cluster_create(NULL),
111-
ESP_ZB_ZCL_CLUSTER_CLIENT_ROLE);
112-
esp_zb_endpoint_config_t endpoint_config = {
113-
.endpoint = ESP_BRIDGE_ON_OFF_ENDPOINT,
114-
.app_profile_id = ESP_ZB_AF_HA_PROFILE_ID,
115-
.app_device_id = ESP_ZB_HA_ON_OFF_OUTPUT_DEVICE_ID,
116-
};
117-
esp_zb_ep_list_t *endpoint_list = esp_zb_ep_list_create();
118-
esp_zb_ep_list_add_ep(endpoint_list, cluster_list, endpoint_config);
119-
esp_zb_device_register(endpoint_list);
120-
121106
/* initiate Zigbee Stack start without zb_send_no_autostart_signal auto-start */
122107
esp_zb_set_primary_network_channel_set(ESP_ZB_PRIMARY_CHANNEL_MASK);
123108
ESP_ERROR_CHECK(esp_zb_start(false));

examples/zigbee_bridge/main/app_zboss.h

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#define MAX_CHILDREN 10 /* the max amount of connected devices */
1616
#define INSTALLCODE_POLICY_ENABLE false /* enable the install code policy for security */
1717
#define ESP_ZB_PRIMARY_CHANNEL_MASK (1l << 13) /* Zigbee primary channel mask use in the example */
18-
#define ESP_BRIDGE_ON_OFF_ENDPOINT (2) /* esp onoff device endpoint, used to send onoff controlling commands */
1918

2019
#define ESP_ZB_ZC_CONFIG() \
2120
{ \

examples/zigbee_bridge/main/zigbee_bridge.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <esp_matter.h>
1414
#include <esp_matter_bridge.h>
1515
#include <zigbee_bridge.h>
16-
#include <app_zboss.h>
1716

1817
static const char *TAG = "zigbee_bridge";
1918

@@ -61,7 +60,7 @@ esp_err_t zigbee_bridge_attribute_update(uint16_t endpoint_id, uint32_t cluster_
6160
esp_zb_zcl_on_off_cmd_t cmd_req;
6261
cmd_req.zcl_basic_cmd.dst_addr_u.addr_short = zigbee_device->dev_addr.zigbee_shortaddr;
6362
cmd_req.zcl_basic_cmd.dst_endpoint = zigbee_device->dev_addr.zigbee_endpointid;
64-
cmd_req.zcl_basic_cmd.src_endpoint = ESP_BRIDGE_ON_OFF_ENDPOINT;
63+
cmd_req.zcl_basic_cmd.src_endpoint = esp_matter::endpoint::get_id(zigbee_device->dev->endpoint);
6564
cmd_req.address_mode = ESP_ZB_APS_ADDR_MODE_16_ENDP_PRESENT;
6665
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;
6766
if (esp_zb_lock_acquire(portMAX_DELAY)) {

0 commit comments

Comments
 (0)