diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e56285b3d..481d0b56d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -328,7 +328,7 @@ build_esp_matter_examples: - openssl genrsa -out secure_boot_signing_key.pem 3072 # steps for external platform build for blemesh_bridge app - - cd ${ESP_MATTER_PATH}/examples/blemesh_bridge + - cd ${ESP_MATTER_PATH}/examples/bridge_apps/blemesh_bridge - cp sdkconfig.defaults sdkconfig.defaults.backup - cp sdkconfig.defaults.ext_plat_ci sdkconfig.defaults diff --git a/components/esp_matter/esp_matter_endpoint.cpp b/components/esp_matter/esp_matter_endpoint.cpp index 49c7acd50..0761fd873 100644 --- a/components/esp_matter/esp_matter_endpoint.cpp +++ b/components/esp_matter/esp_matter_endpoint.cpp @@ -955,7 +955,12 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) endpoint_t *resume(node_t *node, config_t *config, uint8_t flags, uint16_t endpoint_id, void *priv_data) { endpoint_t *endpoint = endpoint::resume(node, flags | ENDPOINT_FLAG_DESTROYABLE, endpoint_id, priv_data); - add(endpoint, config); + VerifyOrReturnValue(endpoint != nullptr, NULL, ESP_LOGE(TAG, "Failed to create endpoint")); + + cluster_t *descriptor_cluster = descriptor::create(endpoint, &(config->descriptor), CLUSTER_FLAG_SERVER); + VerifyOrReturnValue(descriptor_cluster != nullptr, NULL, ESP_LOGE(TAG, "Failed to create descriptor cluster")); + + VerifyOrReturnValue(ESP_OK == add(endpoint, config), NULL, ESP_LOGE(TAG, "Failed to add cluster")); return endpoint; } } /* bridged_node */ diff --git a/docs/en/developing.rst b/docs/en/developing.rst index 4cb9c9610..2643a259b 100644 --- a/docs/en/developing.rst +++ b/docs/en/developing.rst @@ -218,8 +218,8 @@ An example with esp_matter component is offered: - :project_file:`Light ` - :project_file:`Light Switch ` - :project_file:`Zap Light ` -- :project_file:`Zigbee Bridge ` -- :project_file:`BLE Mesh Bridge ` +- :project_file:`Zigbee Bridge ` +- :project_file:`BLE Mesh Bridge ` 2.2.4 Flashing the Firmware ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -440,8 +440,8 @@ for it to work. Check the "Post Commissioning Setup" section in examples for mor - :project_file:`Light ` - :project_file:`Light Switch ` - :project_file:`Zap Light ` -- :project_file:`Zigbee Bridge ` -- :project_file:`BLE Mesh Bridge ` +- :project_file:`Zigbee Bridge ` +- :project_file:`BLE Mesh Bridge ` 2.3.1.3 Cluster Control ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/en/faq.rst b/docs/en/faq.rst index 3da0ff832..c7fa2843b 100644 --- a/docs/en/faq.rst +++ b/docs/en/faq.rst @@ -186,8 +186,8 @@ Difference between Rotating ID Unique ID and Unique ID - :project_file:`Light ` - :project_file:`Light Switch ` - :project_file:`Zap Light ` -- :project_file:`Zigbee Bridge ` -- :project_file:`BLE Mesh Bridge ` +- :project_file:`Zigbee Bridge ` +- :project_file:`BLE Mesh Bridge ` A1.8 ModuleNotFoundError: No module named 'lark' ------------------------------------------------ diff --git a/examples/.build-rules.yml b/examples/.build-rules.yml index 3932b7c9a..3d9256a68 100644 --- a/examples/.build-rules.yml +++ b/examples/.build-rules.yml @@ -3,7 +3,7 @@ # Disabling the external platform builds till we fix the build problem # due to https://github.com/project-chip/connectedhomeip/pull/30531 # JIRA tracker: CON-942 -examples/blemesh_bridge: +examples/bridge_apps/blemesh_bridge: enable: - if: IDF_TARGET in ["esp32", "esp32c3"] temporary: true @@ -39,7 +39,7 @@ examples/multiple_on_off_plugin_units: temporary: true reason: the other targets are not tested yet -examples/esp-now_bridge_light: +examples/bridge_apps/esp-now_bridge_light: enable: - if: IDF_TARGET in ["esp32c3"] temporary: true @@ -51,7 +51,7 @@ examples/controller: temporary: true reason: the other targets are not tested yet -examples/zigbee_bridge: +examples/bridge_apps/zigbee_bridge: enable: - if: IDF_TARGET in ["esp32s3"] temporary: true @@ -122,3 +122,9 @@ examples/thread_border_router: - if: IDF_TARGET in ["esp32s3"] temporary: true reason: the other targets are not tested yet + +examples/bridge_apps/bridge_cli: + enable: + - if: IDF_TARGET in ["esp32", "esp32c3"] + temporary: true + reason: the other targets are not tested yet diff --git a/examples/blemesh_bridge/CMakeLists.txt b/examples/bridge_apps/blemesh_bridge/CMakeLists.txt similarity index 100% rename from examples/blemesh_bridge/CMakeLists.txt rename to examples/bridge_apps/blemesh_bridge/CMakeLists.txt diff --git a/examples/blemesh_bridge/README.md b/examples/bridge_apps/blemesh_bridge/README.md similarity index 100% rename from examples/blemesh_bridge/README.md rename to examples/bridge_apps/blemesh_bridge/README.md diff --git a/examples/blemesh_bridge/main/CMakeLists.txt b/examples/bridge_apps/blemesh_bridge/main/CMakeLists.txt similarity index 100% rename from examples/blemesh_bridge/main/CMakeLists.txt rename to examples/bridge_apps/blemesh_bridge/main/CMakeLists.txt diff --git a/examples/blemesh_bridge/main/app_blemesh.c b/examples/bridge_apps/blemesh_bridge/main/app_blemesh.c similarity index 100% rename from examples/blemesh_bridge/main/app_blemesh.c rename to examples/bridge_apps/blemesh_bridge/main/app_blemesh.c diff --git a/examples/blemesh_bridge/main/app_blemesh.h b/examples/bridge_apps/blemesh_bridge/main/app_blemesh.h similarity index 100% rename from examples/blemesh_bridge/main/app_blemesh.h rename to examples/bridge_apps/blemesh_bridge/main/app_blemesh.h diff --git a/examples/blemesh_bridge/main/app_main.cpp b/examples/bridge_apps/blemesh_bridge/main/app_main.cpp similarity index 100% rename from examples/blemesh_bridge/main/app_main.cpp rename to examples/bridge_apps/blemesh_bridge/main/app_main.cpp diff --git a/examples/blemesh_bridge/main/blemesh_bridge.cpp b/examples/bridge_apps/blemesh_bridge/main/blemesh_bridge.cpp similarity index 100% rename from examples/blemesh_bridge/main/blemesh_bridge.cpp rename to examples/bridge_apps/blemesh_bridge/main/blemesh_bridge.cpp diff --git a/examples/blemesh_bridge/main/blemesh_bridge.h b/examples/bridge_apps/blemesh_bridge/main/blemesh_bridge.h similarity index 100% rename from examples/blemesh_bridge/main/blemesh_bridge.h rename to examples/bridge_apps/blemesh_bridge/main/blemesh_bridge.h diff --git a/examples/blemesh_bridge/partitions.csv b/examples/bridge_apps/blemesh_bridge/partitions.csv similarity index 100% rename from examples/blemesh_bridge/partitions.csv rename to examples/bridge_apps/blemesh_bridge/partitions.csv diff --git a/examples/blemesh_bridge/sdkconfig.defaults b/examples/bridge_apps/blemesh_bridge/sdkconfig.defaults similarity index 100% rename from examples/blemesh_bridge/sdkconfig.defaults rename to examples/bridge_apps/blemesh_bridge/sdkconfig.defaults diff --git a/examples/blemesh_bridge/sdkconfig.defaults.ext_plat_ci b/examples/bridge_apps/blemesh_bridge/sdkconfig.defaults.ext_plat_ci similarity index 100% rename from examples/blemesh_bridge/sdkconfig.defaults.ext_plat_ci rename to examples/bridge_apps/blemesh_bridge/sdkconfig.defaults.ext_plat_ci diff --git a/examples/bridge_apps/bridge_cli/CMakeLists.txt b/examples/bridge_apps/bridge_cli/CMakeLists.txt new file mode 100644 index 000000000..4bf91d615 --- /dev/null +++ b/examples/bridge_apps/bridge_cli/CMakeLists.txt @@ -0,0 +1,43 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +if(NOT DEFINED ENV{ESP_MATTER_PATH}) + message(FATAL_ERROR "Please set ESP_MATTER_PATH to the path of esp-matter repo") +endif(NOT DEFINED ENV{ESP_MATTER_PATH}) + +if(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH}) + if("${IDF_TARGET}" STREQUAL "" OR "${IDF_TARGET}" STREQUAL "esp32" OR "${IDF_TARGET}" STREQUAL "esp32c3" OR "${IDF_TARGET}" STREQUAL "esp32s3") + # use hollow device type because the iot button has a require of 'esp_adc_cal' + # which is renamed to 'esp_adc' in IDF v5.0 + # TODO: set the ESP_MATTER_DEVICE_PATH to a certain target. + set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/hollow) + else() + message(FATAL_ERROR "Unsupported IDF_TARGET") + endif() +endif(NOT DEFINED ENV{ESP_MATTER_DEVICE_PATH}) + +set(PROJECT_VER "1.0") +set(PROJECT_VER_NUMBER 1) + +set(ESP_MATTER_PATH $ENV{ESP_MATTER_PATH}) +set(MATTER_SDK_PATH ${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip) + +# This should be done before using the IDF_TARGET variable. +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake) + +set(EXTRA_COMPONENT_DIRS + "${ESP_MATTER_PATH}/examples/common" + "${MATTER_SDK_PATH}/config/esp32/components" + "${ESP_MATTER_PATH}/components" + "${ESP_MATTER_PATH}/device_hal/device" + ${extra_components_dirs_append}) + +project(bridge_cli) + +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H;-fpermissive;-Wno-overloaded-virtual" APPEND) +idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) +# For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various +# flags that depend on -Wformat +idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security;-Wno-error=cpp" APPEND) diff --git a/examples/bridge_apps/bridge_cli/README.md b/examples/bridge_apps/bridge_cli/README.md new file mode 100644 index 000000000..c754804d3 --- /dev/null +++ b/examples/bridge_apps/bridge_cli/README.md @@ -0,0 +1,44 @@ + +# Bridge Command Line + +This example demonstrates a Bridge Command Line example that can manage virtual bridged devices with device console for bridge tests. + +See the [docs](https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html) for more information about building and flashing the firmware. + +## 1. Additional Environment Setup + +No additional setup is required. + +## 2. Post Commissioning Setup + +Here are some console command to manage the virtual bridged devices. + +- List supported bridged device types + +``` +matter esp bridge support +``` + +- Add bridged device with specific device type + +``` +matter esp bridge add +``` + +- Remove bridged device on an endpoint + +``` +matter esp bridge remove +``` + +- List all the bridged devices + +``` +matter esp bridge list +``` + +- Reset the Bridge, clear all the bridged endpoints and factory-reset + +``` +matter esp bridge reset +``` diff --git a/examples/esp-now_bridge_light/main/CMakeLists.txt b/examples/bridge_apps/bridge_cli/main/CMakeLists.txt similarity index 100% rename from examples/esp-now_bridge_light/main/CMakeLists.txt rename to examples/bridge_apps/bridge_cli/main/CMakeLists.txt diff --git a/examples/bridge_apps/bridge_cli/main/app_main.cpp b/examples/bridge_apps/bridge_cli/main/app_main.cpp new file mode 100644 index 000000000..77f55c578 --- /dev/null +++ b/examples/bridge_apps/bridge_cli/main/app_main.cpp @@ -0,0 +1,102 @@ +/* + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include + +#include +#include +#include +#include + +#include + +static const char *TAG = "app_main"; + +using namespace esp_matter; +using namespace esp_matter::attribute; +using namespace esp_matter::endpoint; + +static void app_event_cb(const ChipDeviceEvent *event, intptr_t arg) +{ + switch (event->Type) { + case chip::DeviceLayer::DeviceEventType::kInterfaceIpAddressChanged: + ESP_LOGI(TAG, "Interface IP Address Changed"); + break; + + case chip::DeviceLayer::DeviceEventType::kCommissioningComplete: + ESP_LOGI(TAG, "Commissioning complete"); + break; + + case chip::DeviceLayer::DeviceEventType::kFailSafeTimerExpired: + ESP_LOGI(TAG, "Commissioning failed, fail safe timer expired"); + break; + + case chip::DeviceLayer::DeviceEventType::kCommissioningSessionStarted: + ESP_LOGI(TAG, "Commissioning session started"); + break; + + case chip::DeviceLayer::DeviceEventType::kCommissioningSessionStopped: + ESP_LOGI(TAG, "Commissioning session stopped"); + break; + + case chip::DeviceLayer::DeviceEventType::kCommissioningWindowOpened: + ESP_LOGI(TAG, "Commissioning window opened"); + break; + + case chip::DeviceLayer::DeviceEventType::kCommissioningWindowClosed: + ESP_LOGI(TAG, "Commissioning window closed"); + break; + + default: + break; + } +} + +// This callback is called for every attribute update. The callback implementation shall +// handle the desired attributes and return an appropriate error code. If the attribute +// is not of your interest, please do not return an error code and strictly return ESP_OK. +static esp_err_t app_attribute_update_cb(callback_type_t type, uint16_t endpoint_id, uint32_t cluster_id, + uint32_t attribute_id, esp_matter_attr_val_t *val, void *priv_data) +{ + esp_err_t err = ESP_OK; + + if (type == PRE_UPDATE) { + ESP_LOGI(TAG, "Pre update of Endpoint 0x%x Cluster 0x%lx attribute_id 0x%lx", endpoint_id, cluster_id, attribute_id); + } + return err; +} + +extern "C" void app_main() +{ + esp_err_t err = ESP_OK; + + /* Initialize the ESP NVS layer */ + nvs_flash_init(); + + /* Create a Matter node and add the mandatory Root Node device type on endpoint 0 */ + node::config_t node_config; + node_t *node = node::create(&node_config, app_attribute_update_cb, NULL); + ABORT_APP_ON_FAILURE(node != nullptr, ESP_LOGE(TAG, "Failed to create Matter node")); + + aggregator::config_t aggregator_config; + endpoint_t *aggregator = endpoint::aggregator::create(node, &aggregator_config, ENDPOINT_FLAG_NONE, NULL); + ABORT_APP_ON_FAILURE(aggregator != nullptr, ESP_LOGE(TAG, "Failed to create aggregator endpoint")); + + /* Matter start */ + err = esp_matter::start(app_event_cb); + ABORT_APP_ON_FAILURE(err == ESP_OK, ESP_LOGE(TAG, "Failed to start Matter, err:%d", err)); + +#if CONFIG_ENABLE_CHIP_SHELL + esp_matter::console::diagnostics_register_commands(); + esp_matter::console::wifi_register_commands(); + esp_matter::console::bridge_register_commands(); + esp_matter::console::init(); +#endif +} diff --git a/examples/zigbee_bridge/partitions.csv b/examples/bridge_apps/bridge_cli/partitions.csv similarity index 100% rename from examples/zigbee_bridge/partitions.csv rename to examples/bridge_apps/bridge_cli/partitions.csv diff --git a/examples/bridge_apps/bridge_cli/sdkconfig.defaults b/examples/bridge_apps/bridge_cli/sdkconfig.defaults new file mode 100644 index 000000000..fa2968919 --- /dev/null +++ b/examples/bridge_apps/bridge_cli/sdkconfig.defaults @@ -0,0 +1,42 @@ +# Default to 921600 baud when flashing and monitoring device +CONFIG_ESPTOOLPY_BAUD_921600B=y +CONFIG_ESPTOOLPY_BAUD=921600 +CONFIG_ESPTOOLPY_COMPRESSED=y +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y + +#enable BT +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y + +#disable BT connection reattempt +CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=n + +#enable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=y + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_OFFSET=0xC000 + +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y + +#enable lwIP route hooks +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y + +# disable softap by default +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n + +# Disable DS Peripheral +CONFIG_ESP_SECURE_CERT_DS_PERIPHERAL=n + +# Enable HKDF in mbedtls +CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number to 6 (MAX_FABRIC + 1) +# unique local addresses for fabrics(MAX_FABRIC), a link local address(1) +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/esp-now_bridge_light/CMakeLists.txt b/examples/bridge_apps/esp-now_bridge_light/CMakeLists.txt similarity index 100% rename from examples/esp-now_bridge_light/CMakeLists.txt rename to examples/bridge_apps/esp-now_bridge_light/CMakeLists.txt diff --git a/examples/esp-now_bridge_light/README.md b/examples/bridge_apps/esp-now_bridge_light/README.md similarity index 100% rename from examples/esp-now_bridge_light/README.md rename to examples/bridge_apps/esp-now_bridge_light/README.md diff --git a/examples/esp-now_bridge_light/docs/bridge-idle-current.png b/examples/bridge_apps/esp-now_bridge_light/docs/bridge-idle-current.png similarity index 100% rename from examples/esp-now_bridge_light/docs/bridge-idle-current.png rename to examples/bridge_apps/esp-now_bridge_light/docs/bridge-idle-current.png diff --git a/examples/esp-now_bridge_light/docs/esp-now-bridge-datamodel.drawio.svg b/examples/bridge_apps/esp-now_bridge_light/docs/esp-now-bridge-datamodel.drawio.svg similarity index 100% rename from examples/esp-now_bridge_light/docs/esp-now-bridge-datamodel.drawio.svg rename to examples/bridge_apps/esp-now_bridge_light/docs/esp-now-bridge-datamodel.drawio.svg diff --git a/examples/esp-now_bridge_light/docs/esp-now-bridge-overall.drawio.svg b/examples/bridge_apps/esp-now_bridge_light/docs/esp-now-bridge-overall.drawio.svg similarity index 100% rename from examples/esp-now_bridge_light/docs/esp-now-bridge-overall.drawio.svg rename to examples/bridge_apps/esp-now_bridge_light/docs/esp-now-bridge-overall.drawio.svg diff --git a/examples/esp-now_bridge_light/docs/esp-now-bridge-with-button.md b/examples/bridge_apps/esp-now_bridge_light/docs/esp-now-bridge-with-button.md similarity index 100% rename from examples/esp-now_bridge_light/docs/esp-now-bridge-with-button.md rename to examples/bridge_apps/esp-now_bridge_light/docs/esp-now-bridge-with-button.md diff --git a/examples/zigbee_bridge/main/CMakeLists.txt b/examples/bridge_apps/esp-now_bridge_light/main/CMakeLists.txt similarity index 100% rename from examples/zigbee_bridge/main/CMakeLists.txt rename to examples/bridge_apps/esp-now_bridge_light/main/CMakeLists.txt diff --git a/examples/esp-now_bridge_light/main/Kconfig.projbuild b/examples/bridge_apps/esp-now_bridge_light/main/Kconfig.projbuild similarity index 100% rename from examples/esp-now_bridge_light/main/Kconfig.projbuild rename to examples/bridge_apps/esp-now_bridge_light/main/Kconfig.projbuild diff --git a/examples/esp-now_bridge_light/main/app_driver.cpp b/examples/bridge_apps/esp-now_bridge_light/main/app_driver.cpp similarity index 100% rename from examples/esp-now_bridge_light/main/app_driver.cpp rename to examples/bridge_apps/esp-now_bridge_light/main/app_driver.cpp diff --git a/examples/esp-now_bridge_light/main/app_espnow.cpp b/examples/bridge_apps/esp-now_bridge_light/main/app_espnow.cpp similarity index 100% rename from examples/esp-now_bridge_light/main/app_espnow.cpp rename to examples/bridge_apps/esp-now_bridge_light/main/app_espnow.cpp diff --git a/examples/esp-now_bridge_light/main/app_espnow.h b/examples/bridge_apps/esp-now_bridge_light/main/app_espnow.h similarity index 100% rename from examples/esp-now_bridge_light/main/app_espnow.h rename to examples/bridge_apps/esp-now_bridge_light/main/app_espnow.h diff --git a/examples/esp-now_bridge_light/main/app_main.cpp b/examples/bridge_apps/esp-now_bridge_light/main/app_main.cpp similarity index 100% rename from examples/esp-now_bridge_light/main/app_main.cpp rename to examples/bridge_apps/esp-now_bridge_light/main/app_main.cpp diff --git a/examples/esp-now_bridge_light/main/app_priv.h b/examples/bridge_apps/esp-now_bridge_light/main/app_priv.h similarity index 100% rename from examples/esp-now_bridge_light/main/app_priv.h rename to examples/bridge_apps/esp-now_bridge_light/main/app_priv.h diff --git a/examples/esp-now_bridge_light/main/espnow_bridge.cpp b/examples/bridge_apps/esp-now_bridge_light/main/espnow_bridge.cpp similarity index 100% rename from examples/esp-now_bridge_light/main/espnow_bridge.cpp rename to examples/bridge_apps/esp-now_bridge_light/main/espnow_bridge.cpp diff --git a/examples/esp-now_bridge_light/main/espnow_bridge.h b/examples/bridge_apps/esp-now_bridge_light/main/espnow_bridge.h similarity index 100% rename from examples/esp-now_bridge_light/main/espnow_bridge.h rename to examples/bridge_apps/esp-now_bridge_light/main/espnow_bridge.h diff --git a/examples/esp-now_bridge_light/main/idf_component.yml b/examples/bridge_apps/esp-now_bridge_light/main/idf_component.yml similarity index 100% rename from examples/esp-now_bridge_light/main/idf_component.yml rename to examples/bridge_apps/esp-now_bridge_light/main/idf_component.yml diff --git a/examples/esp-now_bridge_light/partitions.csv b/examples/bridge_apps/esp-now_bridge_light/partitions.csv similarity index 100% rename from examples/esp-now_bridge_light/partitions.csv rename to examples/bridge_apps/esp-now_bridge_light/partitions.csv diff --git a/examples/esp-now_bridge_light/sdkconfig.defaults b/examples/bridge_apps/esp-now_bridge_light/sdkconfig.defaults similarity index 100% rename from examples/esp-now_bridge_light/sdkconfig.defaults rename to examples/bridge_apps/esp-now_bridge_light/sdkconfig.defaults diff --git a/examples/esp-now_bridge_light/sdkconfig.defaults.esp32s3 b/examples/bridge_apps/esp-now_bridge_light/sdkconfig.defaults.esp32s3 similarity index 100% rename from examples/esp-now_bridge_light/sdkconfig.defaults.esp32s3 rename to examples/bridge_apps/esp-now_bridge_light/sdkconfig.defaults.esp32s3 diff --git a/examples/zigbee_bridge/CMakeLists.txt b/examples/bridge_apps/zigbee_bridge/CMakeLists.txt similarity index 100% rename from examples/zigbee_bridge/CMakeLists.txt rename to examples/bridge_apps/zigbee_bridge/CMakeLists.txt diff --git a/examples/zigbee_bridge/README.md b/examples/bridge_apps/zigbee_bridge/README.md similarity index 100% rename from examples/zigbee_bridge/README.md rename to examples/bridge_apps/zigbee_bridge/README.md diff --git a/examples/bridge_apps/zigbee_bridge/main/CMakeLists.txt b/examples/bridge_apps/zigbee_bridge/main/CMakeLists.txt new file mode 100644 index 000000000..43626a795 --- /dev/null +++ b/examples/bridge_apps/zigbee_bridge/main/CMakeLists.txt @@ -0,0 +1,5 @@ +idf_component_register(SRC_DIRS "." + PRIV_INCLUDE_DIRS "." "${ESP_MATTER_PATH}/examples/common/utils") + +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) +target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/zigbee_bridge/main/Kconfig.projbuild b/examples/bridge_apps/zigbee_bridge/main/Kconfig.projbuild similarity index 100% rename from examples/zigbee_bridge/main/Kconfig.projbuild rename to examples/bridge_apps/zigbee_bridge/main/Kconfig.projbuild diff --git a/examples/zigbee_bridge/main/app_main.cpp b/examples/bridge_apps/zigbee_bridge/main/app_main.cpp similarity index 100% rename from examples/zigbee_bridge/main/app_main.cpp rename to examples/bridge_apps/zigbee_bridge/main/app_main.cpp diff --git a/examples/zigbee_bridge/main/app_zboss.cpp b/examples/bridge_apps/zigbee_bridge/main/app_zboss.cpp similarity index 100% rename from examples/zigbee_bridge/main/app_zboss.cpp rename to examples/bridge_apps/zigbee_bridge/main/app_zboss.cpp diff --git a/examples/zigbee_bridge/main/app_zboss.h b/examples/bridge_apps/zigbee_bridge/main/app_zboss.h similarity index 100% rename from examples/zigbee_bridge/main/app_zboss.h rename to examples/bridge_apps/zigbee_bridge/main/app_zboss.h diff --git a/examples/zigbee_bridge/main/idf_component.yml b/examples/bridge_apps/zigbee_bridge/main/idf_component.yml similarity index 100% rename from examples/zigbee_bridge/main/idf_component.yml rename to examples/bridge_apps/zigbee_bridge/main/idf_component.yml diff --git a/examples/zigbee_bridge/main/zigbee_bridge.cpp b/examples/bridge_apps/zigbee_bridge/main/zigbee_bridge.cpp similarity index 100% rename from examples/zigbee_bridge/main/zigbee_bridge.cpp rename to examples/bridge_apps/zigbee_bridge/main/zigbee_bridge.cpp diff --git a/examples/zigbee_bridge/main/zigbee_bridge.h b/examples/bridge_apps/zigbee_bridge/main/zigbee_bridge.h similarity index 100% rename from examples/zigbee_bridge/main/zigbee_bridge.h rename to examples/bridge_apps/zigbee_bridge/main/zigbee_bridge.h diff --git a/examples/bridge_apps/zigbee_bridge/partitions.csv b/examples/bridge_apps/zigbee_bridge/partitions.csv new file mode 100644 index 000000000..7a3bf117b --- /dev/null +++ b/examples/bridge_apps/zigbee_bridge/partitions.csv @@ -0,0 +1,12 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: Firmware partition offset needs to be 64K aligned, initial 36K (9 sectors) are reserved for bootloader and partition table +esp_secure_cert, 0x3F, ,0xd000, 0x2000, encrypted +nvs, data, nvs, 0x10000, 0xE000, +nvs_keys, data, nvs_keys,, 0x1000, encrypted +otadata, data, ota, , 0x2000 +phy_init, data, phy, , 0x1000, +ota_0, app, ota_0, , 0x1D0000, +ota_1, app, ota_1, , 0x1D0000, +fctry, data, nvs, , 0x6000, +zb_storage, data, fat, , 0x20000 +zb_fct, data, fat, , 1K, diff --git a/examples/zigbee_bridge/sdkconfig.defaults b/examples/bridge_apps/zigbee_bridge/sdkconfig.defaults similarity index 100% rename from examples/zigbee_bridge/sdkconfig.defaults rename to examples/bridge_apps/zigbee_bridge/sdkconfig.defaults diff --git a/examples/zigbee_bridge/sdkconfig.defaults.esp32s3 b/examples/bridge_apps/zigbee_bridge/sdkconfig.defaults.esp32s3 similarity index 100% rename from examples/zigbee_bridge/sdkconfig.defaults.esp32s3 rename to examples/bridge_apps/zigbee_bridge/sdkconfig.defaults.esp32s3 diff --git a/examples/zigbee_bridge/sdkconfig.defaults.zb_gw_board b/examples/bridge_apps/zigbee_bridge/sdkconfig.defaults.zb_gw_board similarity index 100% rename from examples/zigbee_bridge/sdkconfig.defaults.zb_gw_board rename to examples/bridge_apps/zigbee_bridge/sdkconfig.defaults.zb_gw_board