From 937bbd81fe98deb2e449aeb0385d9c751bcc3b00 Mon Sep 17 00:00:00 2001 From: Chirag Atal Date: Fri, 20 May 2022 14:07:59 +0530 Subject: [PATCH] esp-matter: General changes and fixes Some of these are changes corresponding to the spec or to the documentation. zigbee_bridge: Renamed bridge_zigbee to zigbee_bridge. switch: Changed console commands to: matter esp bound/client invoke. --- .gitlab-ci.yml | 10 ++-- components/esp_matter/esp_matter_client.cpp | 4 ++ docs/en/developing.rst | 4 +- docs/en/examples/switch.rst | 12 ++--- .../{bridge_zigbee.rst => zigbee_bridge.rst} | 0 docs/en/faq.rst | 2 +- examples/common/app_bridge/CMakeLists.txt | 2 +- ...evice.cpp => app_zigbee_bridge_device.cpp} | 26 +++++----- ...ee_device.h => app_zigbee_bridge_device.h} | 14 ++--- examples/switch/README.md | 8 +-- examples/switch/main/app_driver.cpp | 52 ++++++++++++++----- .../CMakeLists.txt | 2 +- .../README.md | 0 .../main/CMakeLists.txt | 0 .../main/app_main.cpp | 2 +- .../main/app_zboss.cpp | 2 +- .../main/app_zboss.h | 0 .../main/idf_component.yml | 0 .../PluginApplicationCallbacks.h | 0 .../main/zap-generated/af-gen-event.h | 0 .../main/zap-generated/empty_file.cpp | 0 .../main/zap-generated/endpoint_config.h | 0 .../main/zigbee_bridge.cpp | 10 ++-- .../main/zigbee_bridge.h | 0 .../partitions.csv | 0 .../sdkconfig.defaults | 0 .../sdkconfig.defaults.esp32s3 | 0 27 files changed, 89 insertions(+), 61 deletions(-) rename docs/en/examples/{bridge_zigbee.rst => zigbee_bridge.rst} (100%) rename examples/common/app_bridge/{app_bridge_zigbee_device.cpp => app_zigbee_bridge_device.cpp} (81%) rename examples/common/app_bridge/{app_bridge_zigbee_device.h => app_zigbee_bridge_device.h} (76%) rename examples/{bridge_zigbee => zigbee_bridge}/CMakeLists.txt (98%) rename examples/{bridge_zigbee => zigbee_bridge}/README.md (100%) rename examples/{bridge_zigbee => zigbee_bridge}/main/CMakeLists.txt (100%) rename examples/{bridge_zigbee => zigbee_bridge}/main/app_main.cpp (98%) rename examples/{bridge_zigbee => zigbee_bridge}/main/app_zboss.cpp (99%) rename examples/{bridge_zigbee => zigbee_bridge}/main/app_zboss.h (100%) rename examples/{bridge_zigbee => zigbee_bridge}/main/idf_component.yml (100%) rename examples/{bridge_zigbee => zigbee_bridge}/main/zap-generated/PluginApplicationCallbacks.h (100%) rename examples/{bridge_zigbee => zigbee_bridge}/main/zap-generated/af-gen-event.h (100%) rename examples/{bridge_zigbee => zigbee_bridge}/main/zap-generated/empty_file.cpp (100%) rename examples/{bridge_zigbee => zigbee_bridge}/main/zap-generated/endpoint_config.h (100%) rename examples/{bridge_zigbee => zigbee_bridge}/main/zigbee_bridge.cpp (94%) rename examples/{bridge_zigbee => zigbee_bridge}/main/zigbee_bridge.h (100%) rename examples/{bridge_zigbee => zigbee_bridge}/partitions.csv (100%) rename examples/{bridge_zigbee => zigbee_bridge}/sdkconfig.defaults (100%) rename examples/{bridge_zigbee => zigbee_bridge}/sdkconfig.defaults.esp32s3 (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 389c3e916..fd5308f96 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,12 +17,12 @@ variables: - git clone --recursive --single-branch -b v4.4.1 --reference-if-able /local_references/github/ https://github.com/espressif/esp-idf.git - cd esp-idf - ./install.sh - - . export.sh + - . ./export.sh .setup_idf_v5_0: &setup_idf_v5_0 # - cd $REPOS_PATH # IDF_PATH is set to something else already? # using commit 047903c612 of espressif/esp-idf github repo - # idf_v5_0 is used for bridge_zigbee_example and examples of ESP32-H2 + # idf_v5_0 is used for zigbee_bridge example and examples of ESP32-H2 - git clone --recursive --reference-if-able /local_references/github/ https://github.com/espressif/esp-idf.git - cd esp-idf - git checkout 047903c612e2c7212693c0861966bf7c83430ebf @@ -32,8 +32,8 @@ variables: .setup_matter: &setup_matter - cd $ESP_MATTER_PATH - - source connectedhomeip/connectedhomeip/scripts/bootstrap.sh - - . export.sh + - ./install.sh + - . ./export.sh .build_matter_examples: &build_matter_examples - export MATTER_EXAMPLES_PATH=$ESP_MATTER_PATH/connectedhomeip/connectedhomeip/examples @@ -91,7 +91,7 @@ variables: - cd $ESP_MATTER_PATH/examples/light - idf.py --preview set-target esp32h2 - idf.py build - - cd $ESP_MATTER_PATH/examples/bridge_zigbee + - cd $ESP_MATTER_PATH/examples/zigbee_bridge - idf.py set-target esp32 - idf.py build diff --git a/components/esp_matter/esp_matter_client.cpp b/components/esp_matter/esp_matter_client.cpp index b4d9d57c8..c75cb09a8 100644 --- a/components/esp_matter/esp_matter_client.cpp +++ b/components/esp_matter/esp_matter_client.cpp @@ -61,6 +61,10 @@ esp_err_t connect(int fabric_index, int node_id, int remote_endpoint_id) { /* Get info */ FabricInfo *fabric_info = chip::Server::GetInstance().GetFabricTable().FindFabricWithIndex(fabric_index); + if (!fabric_info) { + ESP_LOGE(TAG, "Couldn't find fabric info"); + return ESP_FAIL; + } PeerId peer_id = fabric_info->GetPeerIdForNode(node_id); /* Find existing */ diff --git a/docs/en/developing.rst b/docs/en/developing.rst index b8edb9e5f..c1400d954 100644 --- a/docs/en/developing.rst +++ b/docs/en/developing.rst @@ -68,7 +68,7 @@ for it to work. Check the example's "Additional Environment Setup" section for m RainMaker Light Switch Zap Light - ZigBee Bridge + ZigBee Bridge 2.1.5 Flashing the Firmware ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -181,7 +181,7 @@ for it to work. Check the example's "Post Commissioning Setup" section for more RainMaker Light Switch Zap Light - ZigBee Bridge + ZigBee Bridge 2.2.1.4 Cluster Control diff --git a/docs/en/examples/switch.rst b/docs/en/examples/switch.rst index 9c44c0701..0aec255a9 100644 --- a/docs/en/examples/switch.rst +++ b/docs/en/examples/switch.rst @@ -44,25 +44,25 @@ Switch specific console commands: :: - matter esp client send_to_binded + matter esp bound invoke - Example: Off: :: - matter esp client send_to_binded 0x1 0x6 0x0 + matter esp bound invoke 0x1 0x6 0x0 - Example: On: :: - matter esp client send_to_binded 0x1 0x6 0x1 + matter esp bound invoke 0x1 0x6 0x1 - Example: Toggle: :: - matter esp client send_to_binded 0x1 0x6 0x2 + matter esp bound invoke 0x1 0x6 0x2 3. Device Performance --------------------- @@ -118,8 +118,8 @@ I cannot send commands to the light from my switch: - Make sure the binding command was a success. - Make sure you are passing the local endpoint_id, and not the remote endpoint_id, to the cluster_update() API. -- If using device console, make sure you are running the ``send_to_binded`` - command and not the ``send`` command. The send command is for devices +- If using device console, make sure you are running the ``bound invoke`` + command and not the ``client invoke`` command. The client commands are for devices which have not been binded. - If you are still facing issues, reproduce the issue on the default example for the device and then raise an `issue `. Make sure diff --git a/docs/en/examples/bridge_zigbee.rst b/docs/en/examples/zigbee_bridge.rst similarity index 100% rename from docs/en/examples/bridge_zigbee.rst rename to docs/en/examples/zigbee_bridge.rst diff --git a/docs/en/faq.rst b/docs/en/faq.rst index 8e6547cda..343f35e12 100644 --- a/docs/en/faq.rst +++ b/docs/en/faq.rst @@ -150,4 +150,4 @@ The LED on my devkit is not working: RainMaker Light Switch Zap Light - ZigBee Bridge + ZigBee Bridge diff --git a/examples/common/app_bridge/CMakeLists.txt b/examples/common/app_bridge/CMakeLists.txt index be96ab727..338b9269a 100644 --- a/examples/common/app_bridge/CMakeLists.txt +++ b/examples/common/app_bridge/CMakeLists.txt @@ -1,5 +1,5 @@ if(CONFIG_ZB_ENABLED) - set(srcs app_bridge_zigbee_device.cpp) + set(srcs app_zigbee_bridge_device.cpp) endif() idf_component_register(SRCS "${srcs}" diff --git a/examples/common/app_bridge/app_bridge_zigbee_device.cpp b/examples/common/app_bridge/app_zigbee_bridge_device.cpp similarity index 81% rename from examples/common/app_bridge/app_bridge_zigbee_device.cpp rename to examples/common/app_bridge/app_zigbee_bridge_device.cpp index 41b8b0015..8afeb4b86 100644 --- a/examples/common/app_bridge/app_bridge_zigbee_device.cpp +++ b/examples/common/app_bridge/app_zigbee_bridge_device.cpp @@ -16,22 +16,22 @@ #include #include -#include +#include using esp_matter::node_t; -static const char *TAG = "esp_matter_bridge_zigbee"; -static app_bridge_zigbee_device_t *device_list = NULL; +static const char *TAG = "esp_matter_zigbee_bridge"; +static app_zigbee_bridge_device_t *device_list = NULL; static uint8_t current_bridged_device_count = 0; -app_bridge_zigbee_device_t *app_bridge_create_zigbee_device(node_t *node, uint8_t zigbee_endpointid, +app_zigbee_bridge_device_t *app_bridge_create_zigbee_device(node_t *node, uint8_t zigbee_endpointid, uint16_t zigbee_shortaddr) { if (current_bridged_device_count >= MAX_BRIDGED_DEVICE_COUNT) { ESP_LOGE(TAG, "The device list is full, Could not add a zigbee bridged device"); return NULL; } - app_bridge_zigbee_device_t *new_dev = (app_bridge_zigbee_device_t *)calloc(1, sizeof(app_bridge_zigbee_device_t)); + app_zigbee_bridge_device_t *new_dev = (app_zigbee_bridge_device_t *)calloc(1, sizeof(app_zigbee_bridge_device_t)); new_dev->dev = esp_matter_bridge_create_device(node); if (!(new_dev->dev)) { ESP_LOGE(TAG, "Failed to create the basic bridged device"); @@ -48,7 +48,7 @@ app_bridge_zigbee_device_t *app_bridge_create_zigbee_device(node_t *node, uint8_ uint16_t app_bridge_get_zigbee_shortaddr_by_matter_endpointid(int matter_endpointid) { - app_bridge_zigbee_device_t *current_dev = device_list; + app_zigbee_bridge_device_t *current_dev = device_list; while (current_dev) { if (current_dev->dev && (current_dev->dev->endpoint_id == matter_endpointid)) { return current_dev->zigbee_shortaddr; @@ -60,7 +60,7 @@ uint16_t app_bridge_get_zigbee_shortaddr_by_matter_endpointid(int matter_endpoin int app_bridge_get_matter_endpointid_by_zigbee_shortaddr(uint16_t zigbee_shortaddr) { - app_bridge_zigbee_device_t *current_dev = device_list; + app_zigbee_bridge_device_t *current_dev = device_list; while (current_dev) { if (current_dev->zigbee_shortaddr == zigbee_shortaddr && current_dev->dev) { return current_dev->dev->endpoint_id; @@ -70,9 +70,9 @@ int app_bridge_get_matter_endpointid_by_zigbee_shortaddr(uint16_t zigbee_shortad return -1; } -app_bridge_zigbee_device_t *app_bridge_get_zigbee_device_by_matter_endpointid(int matter_endpointid) +app_zigbee_bridge_device_t *app_bridge_get_zigbee_device_by_matter_endpointid(int matter_endpointid) { - app_bridge_zigbee_device_t *current_dev = device_list; + app_zigbee_bridge_device_t *current_dev = device_list; while (current_dev) { if (current_dev->dev && (current_dev->dev->endpoint_id == matter_endpointid)) { return current_dev; @@ -82,9 +82,9 @@ app_bridge_zigbee_device_t *app_bridge_get_zigbee_device_by_matter_endpointid(in return NULL; } -app_bridge_zigbee_device_t *app_bridge_get_zigbee_device_by_zigbee_shortaddr(uint16_t zigbee_shortaddr) +app_zigbee_bridge_device_t *app_bridge_get_zigbee_device_by_zigbee_shortaddr(uint16_t zigbee_shortaddr) { - app_bridge_zigbee_device_t *current_dev = device_list; + app_zigbee_bridge_device_t *current_dev = device_list; while (current_dev) { if (current_dev->zigbee_shortaddr == zigbee_shortaddr && current_dev->dev) { return current_dev; @@ -94,10 +94,10 @@ app_bridge_zigbee_device_t *app_bridge_get_zigbee_device_by_zigbee_shortaddr(uin return NULL; } -esp_err_t app_bridge_remove_zigbee_device(app_bridge_zigbee_device_t *bridged_device) +esp_err_t app_bridge_remove_zigbee_device(app_zigbee_bridge_device_t *bridged_device) { esp_err_t error = ESP_OK; - app_bridge_zigbee_device_t *current_dev = NULL; + app_zigbee_bridge_device_t *current_dev = NULL; if (!bridged_device) { return ESP_ERR_INVALID_ARG; } diff --git a/examples/common/app_bridge/app_bridge_zigbee_device.h b/examples/common/app_bridge/app_zigbee_bridge_device.h similarity index 76% rename from examples/common/app_bridge/app_bridge_zigbee_device.h rename to examples/common/app_bridge/app_zigbee_bridge_device.h index 2471b7ca4..443fcb268 100644 --- a/examples/common/app_bridge/app_bridge_zigbee_device.h +++ b/examples/common/app_bridge/app_zigbee_bridge_device.h @@ -19,23 +19,23 @@ using esp_matter::node_t; -typedef struct app_bridge_zigbee_device { +typedef struct app_zigbee_bridge_device { esp_matter_bridge_device_t *dev; uint8_t zigbee_endpointid; uint16_t zigbee_shortaddr; - struct app_bridge_zigbee_device *next; -} app_bridge_zigbee_device_t; + struct app_zigbee_bridge_device *next; +} app_zigbee_bridge_device_t; -app_bridge_zigbee_device_t *app_bridge_create_zigbee_device(node_t *node, uint8_t zigbee_endpointid, +app_zigbee_bridge_device_t *app_bridge_create_zigbee_device(node_t *node, uint8_t zigbee_endpointid, uint16_t zigbee_shortaddr); uint16_t app_bridge_get_zigbee_shortaddr_by_matter_endpointid(int matter_endpointid); int app_bridge_get_matter_endpointid_by_zigbee_shortaddr(uint16_t zigbee_shortaddr); -app_bridge_zigbee_device_t *app_bridge_get_zigbee_device_by_matter_endpointid(int matter_endpointid); +app_zigbee_bridge_device_t *app_bridge_get_zigbee_device_by_matter_endpointid(int matter_endpointid); -app_bridge_zigbee_device_t *app_bridge_get_zigbee_device_by_zigbee_shortaddr(uint16_t zigbee_shortaddr); +app_zigbee_bridge_device_t *app_bridge_get_zigbee_device_by_zigbee_shortaddr(uint16_t zigbee_shortaddr); -esp_err_t app_bridge_remove_zigbee_device(app_bridge_zigbee_device_t *bridged_device); +esp_err_t app_bridge_remove_zigbee_device(app_zigbee_bridge_device_t *bridged_device); #endif diff --git a/examples/switch/README.md b/examples/switch/README.md index 334555525..cafc07de7 100644 --- a/examples/switch/README.md +++ b/examples/switch/README.md @@ -34,7 +34,7 @@ note: After the binding is successful you can send the following command to control light from switch ``` -> matter esp client send_to_binded +> matter esp bound invoke ``` here, endpoint_id, cluster_id, command_id of switch must be given in hex format @@ -43,17 +43,17 @@ e.g. - Power Off command ``` -> matter esp client send_to_binded 0x0001 0x0006 0x0000 +> matter esp bound invoke 0x0001 0x0006 0x0000 ``` - Power On command ``` -> matter esp client send_to_binded 0x0001 0x0006 0x0001 +> matter esp bound invoke 0x0001 0x0006 0x0001 ``` - Toggle command ``` -> matter esp client send_to_binded 0x0001 0x0006 0x0002 +> matter esp bound invoke 0x0001 0x0006 0x0002 ``` diff --git a/examples/switch/main/app_driver.cpp b/examples/switch/main/app_driver.cpp index 1ed338ed4..4929ce166 100644 --- a/examples/switch/main/app_driver.cpp +++ b/examples/switch/main/app_driver.cpp @@ -29,16 +29,14 @@ extern int switch_endpoint_id; static int g_cluster_id = kInvalidClusterId; static int g_command_id = kInvalidCommandId; -static esp_err_t app_driver_console_handler(int argc, char **argv) +static esp_err_t app_driver_bound_console_handler(int argc, char **argv) { if (argc == 1 && strncmp(argv[0], "help", sizeof("help")) == 0) { - printf("Driver commands:\n" + printf("Bound commands:\n" "\thelp: Print help\n" - "\tsend_to_binded: . " - "Example: matter esp client send_to_binded 0x0001 0x0006 0x0002.\n" - "\tsend: . " - "Example: matter esp client send 0x0001 0xBC5C01 0x0001 0x0006 0x0002.\n"); - } else if (argc == 4 && strncmp(argv[0], "send_to_binded", sizeof("send_to_binded")) == 0) { + "\tinvoke: . " + "Example: matter esp bound invoke 0x0001 0x0006 0x0002.\n"); + } else if (argc == 4 && strncmp(argv[0], "invoke", sizeof("invoke")) == 0) { int endpoint_id = strtol((const char *)&argv[1][2], NULL, 16); int cluster_id = strtol((const char *)&argv[2][2], NULL, 16); int command_id = strtol((const char *)&argv[3][2], NULL, 16); @@ -46,7 +44,21 @@ static esp_err_t app_driver_console_handler(int argc, char **argv) g_cluster_id = cluster_id; g_command_id = command_id; client::cluster_update(endpoint_id, cluster_id); - } else if (argc == 6 && strncmp(argv[0], "send", sizeof("send")) == 0) { + } else { + ESP_LOGE(TAG, "Incorrect arguments. Check help for more details."); + return ESP_ERR_INVALID_ARG; + } + return ESP_OK; +} + +static esp_err_t app_driver_client_console_handler(int argc, char **argv) +{ + if (argc == 1 && strncmp(argv[0], "help", sizeof("help")) == 0) { + printf("Client commands:\n" + "\thelp: Print help\n" + "\tinvoke: . " + "Example: matter esp client invoke 0x0001 0xBC5C01 0x0001 0x0006 0x0002.\n"); + } else if (argc == 6 && strncmp(argv[0], "invoke", sizeof("invoke")) == 0) { int fabric_index = strtol((const char *)&argv[1][2], NULL, 16); int node_id = strtol((const char *)&argv[2][2], NULL, 16); int remote_endpoint_id = strtol((const char *)&argv[3][2], NULL, 16); @@ -65,13 +77,25 @@ static esp_err_t app_driver_console_handler(int argc, char **argv) static void app_driver_register_commands() { - esp_matter_console_command_t command = { - .name = "client", - .description = "This can be used to simulate on-device control. Usage: matter esp client . " - "Driver commands: help, send, send_to_binded", - .handler = app_driver_console_handler, + /* Add console command for bound devices */ + esp_matter_console_command_t bound_command = { + .name = "bound", + .description = "This can be used to simulate on-device control for bound devices." + "Usage: matter esp bound . " + "Bound commands: help, invoke", + .handler = app_driver_bound_console_handler, }; - esp_matter_console_add_command(&command); + esp_matter_console_add_command(&bound_command); + + /* Add console command for client to control non-bound devices */ + esp_matter_console_command_t client_command = { + .name = "client", + .description = "This can be used to simulate on-device control for client devices." + "Usage: matter esp client . " + "Client commands: help, invoke", + .handler = app_driver_client_console_handler, + }; + esp_matter_console_add_command(&client_command); } void app_driver_client_command_callback(client::peer_device_t *peer_device, int remote_endpoint_id, void *priv_data) diff --git a/examples/bridge_zigbee/CMakeLists.txt b/examples/zigbee_bridge/CMakeLists.txt similarity index 98% rename from examples/bridge_zigbee/CMakeLists.txt rename to examples/zigbee_bridge/CMakeLists.txt index aeb5a01e9..2df36567c 100644 --- a/examples/bridge_zigbee/CMakeLists.txt +++ b/examples/zigbee_bridge/CMakeLists.txt @@ -36,7 +36,7 @@ set(EXTRA_COMPONENT_DIRS "${ESP_MATTER_PATH}/device_hal/device" ${extra_components_dirs_append}) -project(bridge_zigbee) +project(zigbee_bridge) idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H;-fpermissive" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) diff --git a/examples/bridge_zigbee/README.md b/examples/zigbee_bridge/README.md similarity index 100% rename from examples/bridge_zigbee/README.md rename to examples/zigbee_bridge/README.md diff --git a/examples/bridge_zigbee/main/CMakeLists.txt b/examples/zigbee_bridge/main/CMakeLists.txt similarity index 100% rename from examples/bridge_zigbee/main/CMakeLists.txt rename to examples/zigbee_bridge/main/CMakeLists.txt diff --git a/examples/bridge_zigbee/main/app_main.cpp b/examples/zigbee_bridge/main/app_main.cpp similarity index 98% rename from examples/bridge_zigbee/main/app_main.cpp rename to examples/zigbee_bridge/main/app_main.cpp index 0a256a8b3..7bb95a227 100644 --- a/examples/bridge_zigbee/main/app_main.cpp +++ b/examples/zigbee_bridge/main/app_main.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include diff --git a/examples/bridge_zigbee/main/app_zboss.cpp b/examples/zigbee_bridge/main/app_zboss.cpp similarity index 99% rename from examples/bridge_zigbee/main/app_zboss.cpp rename to examples/zigbee_bridge/main/app_zboss.cpp index e1e8aa96d..0a0e839a8 100644 --- a/examples/bridge_zigbee/main/app_zboss.cpp +++ b/examples/zigbee_bridge/main/app_zboss.cpp @@ -111,7 +111,7 @@ void zboss_signal_handler(zb_bufid_t bufid) void zboss_task() { - ZB_INIT("bridge zigbee"); + ZB_INIT("zigbee bridge"); zb_set_network_coordinator_role(IEEE_CHANNEL_MASK); zb_set_nvram_erase_at_start(ERASE_PERSISTENT_CONFIG); zb_set_max_children(MAX_CHILDREN); diff --git a/examples/bridge_zigbee/main/app_zboss.h b/examples/zigbee_bridge/main/app_zboss.h similarity index 100% rename from examples/bridge_zigbee/main/app_zboss.h rename to examples/zigbee_bridge/main/app_zboss.h diff --git a/examples/bridge_zigbee/main/idf_component.yml b/examples/zigbee_bridge/main/idf_component.yml similarity index 100% rename from examples/bridge_zigbee/main/idf_component.yml rename to examples/zigbee_bridge/main/idf_component.yml diff --git a/examples/bridge_zigbee/main/zap-generated/PluginApplicationCallbacks.h b/examples/zigbee_bridge/main/zap-generated/PluginApplicationCallbacks.h similarity index 100% rename from examples/bridge_zigbee/main/zap-generated/PluginApplicationCallbacks.h rename to examples/zigbee_bridge/main/zap-generated/PluginApplicationCallbacks.h diff --git a/examples/bridge_zigbee/main/zap-generated/af-gen-event.h b/examples/zigbee_bridge/main/zap-generated/af-gen-event.h similarity index 100% rename from examples/bridge_zigbee/main/zap-generated/af-gen-event.h rename to examples/zigbee_bridge/main/zap-generated/af-gen-event.h diff --git a/examples/bridge_zigbee/main/zap-generated/empty_file.cpp b/examples/zigbee_bridge/main/zap-generated/empty_file.cpp similarity index 100% rename from examples/bridge_zigbee/main/zap-generated/empty_file.cpp rename to examples/zigbee_bridge/main/zap-generated/empty_file.cpp diff --git a/examples/bridge_zigbee/main/zap-generated/endpoint_config.h b/examples/zigbee_bridge/main/zap-generated/endpoint_config.h similarity index 100% rename from examples/bridge_zigbee/main/zap-generated/endpoint_config.h rename to examples/zigbee_bridge/main/zap-generated/endpoint_config.h diff --git a/examples/bridge_zigbee/main/zigbee_bridge.cpp b/examples/zigbee_bridge/main/zigbee_bridge.cpp similarity index 94% rename from examples/bridge_zigbee/main/zigbee_bridge.cpp rename to examples/zigbee_bridge/main/zigbee_bridge.cpp index 93a06e6c5..dd024e626 100644 --- a/examples/bridge_zigbee/main/zigbee_bridge.cpp +++ b/examples/zigbee_bridge/main/zigbee_bridge.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -56,7 +56,7 @@ void zigbee_bridge_match_bridged_onoff_light_cb(zb_bufid_t bufid) ESP_LOGI(TAG, "Bridged node for 0x%04x zigbee device on endpoint %d has been created", p_ind->src_addr, app_bridge_get_matter_endpointid_by_zigbee_shortaddr(p_ind->src_addr)); } else { - app_bridge_zigbee_device_t *dev = app_bridge_create_zigbee_device(node, *p_match_ep, p_ind->src_addr); + app_zigbee_bridge_device_t *dev = app_bridge_create_zigbee_device(node, *p_match_ep, p_ind->src_addr); ESP_GOTO_ON_FALSE(dev, ESP_FAIL, exit, TAG, "Failed to create zigbee bridged device (on_off light)"); ESP_GOTO_ON_ERROR(init_bridged_onoff_light(dev->dev), exit, TAG, "Failed to initialize the bridged node"); ESP_LOGI(TAG, "Create/Update bridged node for 0x%04x zigbee device on endpoint %d", p_ind->src_addr, @@ -106,7 +106,7 @@ void zigbee_bridge_match_bridged_onoff_light_timeout(zb_bufid_t bufid) void zigbee_bridge_send_on(zb_uint8_t buf, zb_uint16_t zigbee_shortaddr) { - app_bridge_zigbee_device_t *dev = app_bridge_get_zigbee_device_by_zigbee_shortaddr(zigbee_shortaddr); + app_zigbee_bridge_device_t *dev = app_bridge_get_zigbee_device_by_zigbee_shortaddr(zigbee_shortaddr); ZB_ZCL_ON_OFF_SEND_REQ(buf, zigbee_shortaddr, ZB_APS_ADDR_MODE_16_ENDP_PRESENT, dev->zigbee_endpointid, dev->dev->endpoint_id, ZB_AF_HA_PROFILE_ID, ZB_ZCL_DISABLE_DEFAULT_RESPONSE, ZB_ZCL_CMD_ON_OFF_ON_ID, NULL); @@ -114,7 +114,7 @@ void zigbee_bridge_send_on(zb_uint8_t buf, zb_uint16_t zigbee_shortaddr) void zigbee_bridge_send_off(zb_uint8_t buf, zb_uint16_t zigbee_shortaddr) { - app_bridge_zigbee_device_t *dev = app_bridge_get_zigbee_device_by_zigbee_shortaddr(zigbee_shortaddr); + app_zigbee_bridge_device_t *dev = app_bridge_get_zigbee_device_by_zigbee_shortaddr(zigbee_shortaddr); ZB_ZCL_ON_OFF_SEND_REQ(buf, zigbee_shortaddr, ZB_APS_ADDR_MODE_16_ENDP_PRESENT, dev->zigbee_endpointid, dev->dev->endpoint_id, ZB_AF_HA_PROFILE_ID, ZB_ZCL_DISABLE_DEFAULT_RESPONSE, ZB_ZCL_CMD_ON_OFF_OFF_ID, NULL); @@ -122,7 +122,7 @@ void zigbee_bridge_send_off(zb_uint8_t buf, zb_uint16_t zigbee_shortaddr) esp_err_t zigbee_bridge_attribute_update(int endpoint_id, int cluster_id, int attribute_id, esp_matter_attr_val_t *val) { - app_bridge_zigbee_device_t *zigbee_device = app_bridge_get_zigbee_device_by_matter_endpointid(endpoint_id); + app_zigbee_bridge_device_t *zigbee_device = app_bridge_get_zigbee_device_by_matter_endpointid(endpoint_id); if (zigbee_device && zigbee_device->dev && zigbee_device->dev->endpoint) { if (cluster_id == OnOff::Id) { if (attribute_id == OnOff::Attributes::OnOff::Id) { diff --git a/examples/bridge_zigbee/main/zigbee_bridge.h b/examples/zigbee_bridge/main/zigbee_bridge.h similarity index 100% rename from examples/bridge_zigbee/main/zigbee_bridge.h rename to examples/zigbee_bridge/main/zigbee_bridge.h diff --git a/examples/bridge_zigbee/partitions.csv b/examples/zigbee_bridge/partitions.csv similarity index 100% rename from examples/bridge_zigbee/partitions.csv rename to examples/zigbee_bridge/partitions.csv diff --git a/examples/bridge_zigbee/sdkconfig.defaults b/examples/zigbee_bridge/sdkconfig.defaults similarity index 100% rename from examples/bridge_zigbee/sdkconfig.defaults rename to examples/zigbee_bridge/sdkconfig.defaults diff --git a/examples/bridge_zigbee/sdkconfig.defaults.esp32s3 b/examples/zigbee_bridge/sdkconfig.defaults.esp32s3 similarity index 100% rename from examples/bridge_zigbee/sdkconfig.defaults.esp32s3 rename to examples/zigbee_bridge/sdkconfig.defaults.esp32s3