diff --git a/.flake8 b/.flake8 index c2a1ce2c574fa0..03d013f52334a3 100644 --- a/.flake8 +++ b/.flake8 @@ -27,14 +27,12 @@ exclude = third_party scripts/build/builders/gn.py scripts/build/builders/imx.py scripts/build/builders/infineon.py - scripts/build/builders/nrf.py scripts/codegen.py scripts/codepregen.py scripts/error_table.py scripts/examples/gn_to_cmakelists.py scripts/flashing/bouffalolab_firmware_utils.py scripts/flashing/cyw30739_firmware_utils.py - scripts/flashing/nrfconnect_firmware_utils.py scripts/gen_chip_version.py scripts/helpers/bloat_check.py scripts/pregenerate/using_codegen.py @@ -51,15 +49,11 @@ exclude = third_party scripts/py_matter_yamltests/test_yaml_loader.py scripts/py_matter_yamltests/test_yaml_parser.py scripts/run-clang-tidy-on-compile-commands.py - scripts/setup/nrfconnect/update_ncs.py scripts/tests/chiptest/yamltest_with_chip_repl_tester.py scripts/tools/check_zcl_file_sync.py scripts/tools/convert_ini.py scripts/tools/memory/memdf/__init__.py scripts/tools/memory/report_summary.py - scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py - scripts/tools/nrfconnect/nrfconnect_generate_partition.py - scripts/tools/nrfconnect/tests/test_generate_factory_data.py scripts/tools/silabs/FactoryDataProvider.py scripts/tools/telink/mfg_tool.py scripts/tools/zap/generate.py diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 194d6c800f953f..2d43504f1cd83d 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -1205,6 +1205,7 @@ SHA ShadeConfiguration SHAs showDocumentation +showsdks shubhamdp SIGINT SiLabs @@ -1480,6 +1481,7 @@ xbef xc xcd Xcode +xcodebuild xcodeproj xcworkspace xd diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5686eb04e38fc5..25f780d6bfb530 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -601,6 +601,54 @@ jobs: --tool-args "onnetwork-long --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ --factoryreset \ ' + - name: Run IM Invoke Test + timeout-minutes: 10 + run: | + scripts/run_in_build_env.sh \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' + - name: Run IM Read Test + timeout-minutes: 10 + run: | + scripts/run_in_build_env.sh \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-read --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' + - name: Run IM Write Test + timeout-minutes: 10 + run: | + scripts/run_in_build_env.sh \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-write --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' + - name: Run IM Subscribe Test + timeout-minutes: 10 + run: | + scripts/run_in_build_env.sh \ + './scripts/tests/run_java_test.py \ + --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \ + --app-args "--discriminator 3840 --interface-id -1" \ + --tool-path out/linux-x64-java-matter-controller \ + --tool-cluster "im" \ + --tool-args "onnetwork-long-im-subscribe --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --factoryreset \ + ' - name: Run Pairing AlreadyDiscovered Test timeout-minutes: 10 run: | diff --git a/.pullapprove.yml b/.pullapprove.yml index 74eee17032a03e..f92717408353a7 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -144,14 +144,20 @@ groups: teams: [reviewers-samsung] reviews: request: 10 - shared-reviewers-signify: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-signify] - reviews: - request: 10 + # shared-reviewers-signify disabled for now, because the reviewers-signify + # team is empty and pullapprove seems to mis-handle that badly and treats + # _all_ reviewers as being in this group. + # + # See https://github.com/dropseed/pullapprove/issues/71 + # + # shared-reviewers-signify: + # type: optional + # conditions: + # - files.include('*') + # reviewers: + # teams: [reviewers-signify] + # reviews: + # request: 10 shared-reviewers-silabs: type: optional conditions: diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index a878b95ee3f5b8..e31baa2e0a6be2 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -143,6 +143,18 @@ else() chip_gn_arg_append("chip_enable_wifi" "false") endif() +if (CONFIG_ENABLE_CHIPOBLE) + chip_gn_arg_append("chip_enable_chipoble" "true") +endif() + +if ((CONFIG_BT_ENABLED) AND (CONFIG_ENABLE_CHIPOBLE)) + if (CONFIG_BT_NIMBLE_ENABLED) + chip_gn_arg_append("chip_bt_nimble_enabled" "true") + else() + chip_gn_arg_append("chip_bt_bluedroid_enabled" "true") + endif() +endif() + if (CONFIG_OPENTHREAD_ENABLED) chip_gn_arg_append("chip_enable_openthread" "true") endif() @@ -292,9 +304,7 @@ if(CONFIG_BT_ENABLED) if("${CONFIG_IDF_TARGET}" STREQUAL "esp32h2") idf_component_get_property(bt_dir bt COMPONENT_DIR) list(APPEND chip_libraries $) - if(CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2) - list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32h2/esp32h2-bt-lib/beta2/libble_app.a) - endif() + list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32h2/esp32h2-bt-lib/libble_app.a) elseif("${CONFIG_IDF_TARGET}" STREQUAL "esp32c2") idf_component_get_property(bt_dir bt COMPONENT_DIR) list(APPEND chip_libraries $) diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index c5b645bb2db069..2b2175f3e834c3 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -886,6 +886,21 @@ menu "CHIP Device Layer" default 900 help The amount of time (in seconds) after which the CHIP platform will close the Commissioning Window + endmenu + + menu "Enable ESP32 as a BLE Commissioner" + config ENABLE_ESP32_BLE_CONTROLLER + bool "Enable ESP32 as a BLE Commissioner" + default n + help + Enable esp32 as a BLE Commissioner. + + config ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE + bool "Enable Commissionee and Commissioner mode" + default n + depends on ENABLE_ESP32_BLE_Controller + help + Enable including commissioner code (CHIPDeviceController.cpp) in the commissionee (Server.cpp) code. endmenu diff --git a/config/esp32/components/chip/idf_component.yml b/config/esp32/components/chip/idf_component.yml index e47917975ce13d..7ffcad18792541 100644 --- a/config/esp32/components/chip/idf_component.yml +++ b/config/esp32/components/chip/idf_component.yml @@ -4,3 +4,4 @@ dependencies: version: "^1.0.3" rules: - if: "idf_version >=5.0" + - if: "target != esp32h2" diff --git a/docs/guides/android_building.md b/docs/guides/android_building.md index 02a3653f298186..d225d5e036129a 100644 --- a/docs/guides/android_building.md +++ b/docs/guides/android_building.md @@ -45,7 +45,7 @@ directory. You need Android SDK 21 & NDK 21.4.7075529 downloaded to your machine. Set the `$ANDROID_HOME` environment variable to where the SDK is downloaded and the `$ANDROID_NDK_HOME` environment variable to point to where the NDK package is -downloaded. +downloaded. The build also requires `kotlinc` to be in your `$PATH`. 1. Install [Android Studio](https://developer.android.com/studio) 2. Install NDK: diff --git a/docs/guides/esp32/setup_idf_chip.md b/docs/guides/esp32/setup_idf_chip.md index 63303c79a5dfca..bd30222934dcb4 100644 --- a/docs/guides/esp32/setup_idf_chip.md +++ b/docs/guides/esp32/setup_idf_chip.md @@ -39,23 +39,12 @@ step. $ ./install.sh ``` -- For ESP32H2, please checkout tag - [v5.0](https://github.com/espressif/esp-idf/tree/v5.0), currently only - lighting-app is supported on H2 +- For ESP32C6 & ESP32H2, please use commit + [47852846d3](https://github.com/espressif/esp-idf/tree/47852846d3). ``` $ cd esp-idf - $ git checkout v5.0-beta1 - $ git submodule update --init - $ ./install.sh - ``` - -- For ESP32C6, please use commit - [afbdb0f3e](https://github.com/espressif/esp-idf/tree/afbdb0f3e). - - ``` - $ cd esp-idf - $ git checkout afbdb0f3e + $ git checkout 47852846d3 $ git submodule update --init $ ./install.sh ``` diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 0dd8835474050a..7bdd60bf91a82f 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -13451,7 +13451,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -13547,7 +13547,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "1", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -13611,7 +13611,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -13659,7 +13659,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -13691,7 +13691,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 diff --git a/examples/all-clusters-app/ameba/main/include/ColorControlCommands.h b/examples/all-clusters-app/ameba/main/include/ColorControlCommands.h index 00e36e434160b6..1e2b1bf02ddd40 100644 --- a/examples/all-clusters-app/ameba/main/include/ColorControlCommands.h +++ b/examples/all-clusters-app/ameba/main/include/ColorControlCommands.h @@ -324,6 +324,8 @@ void ProcessColorControlUnicastBindingRead(BindingCommandData * data, const Embe void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const EmberBindingTableEntry & binding, OperationalDeviceProxy * peer_device) { + using namespace Clusters::ColorControl; + auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) { ChipLogProgress(NotSpecified, "ColorControl command succeeds"); }; @@ -358,7 +360,7 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E { case Clusters::ColorControl::Commands::MoveToHue::Id: moveToHueCommand.hue = static_cast(data->args[0]); - moveToHueCommand.direction = static_cast(data->args[1]); + moveToHueCommand.direction = static_cast(data->args[1]); moveToHueCommand.transitionTime = static_cast(data->args[2]); moveToHueCommand.optionsMask = static_cast(data->args[3]); moveToHueCommand.optionsOverride = static_cast(data->args[4]); @@ -367,7 +369,7 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E break; case Clusters::ColorControl::Commands::MoveHue::Id: - moveHueCommand.moveMode = static_cast(data->args[0]); + moveHueCommand.moveMode = static_cast(data->args[0]); moveHueCommand.rate = static_cast(data->args[1]); moveHueCommand.optionsMask = static_cast(data->args[2]); moveHueCommand.optionsOverride = static_cast(data->args[3]); @@ -376,7 +378,7 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E break; case Clusters::ColorControl::Commands::StepHue::Id: - stepHueCommand.stepMode = static_cast(data->args[0]); + stepHueCommand.stepMode = static_cast(data->args[0]); stepHueCommand.stepSize = static_cast(data->args[1]); stepHueCommand.transitionTime = static_cast(data->args[2]); stepHueCommand.optionsMask = static_cast(data->args[3]); @@ -395,7 +397,7 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E break; case Clusters::ColorControl::Commands::MoveSaturation::Id: - moveSaturationCommand.moveMode = static_cast(data->args[0]); + moveSaturationCommand.moveMode = static_cast(data->args[0]); moveSaturationCommand.rate = static_cast(data->args[1]); moveSaturationCommand.optionsMask = static_cast(data->args[2]); moveSaturationCommand.optionsOverride = static_cast(data->args[3]); @@ -404,7 +406,7 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E break; case Clusters::ColorControl::Commands::StepSaturation::Id: - stepSaturationCommand.stepMode = static_cast(data->args[0]); + stepSaturationCommand.stepMode = static_cast(data->args[0]); stepSaturationCommand.stepSize = static_cast(data->args[1]); stepSaturationCommand.transitionTime = static_cast(data->args[2]); stepSaturationCommand.optionsMask = static_cast(data->args[3]); @@ -463,7 +465,7 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E case Clusters::ColorControl::Commands::EnhancedMoveToHue::Id: enhancedMoveToHueCommand.enhancedHue = static_cast(data->args[0]); - enhancedMoveToHueCommand.direction = static_cast(data->args[1]); + enhancedMoveToHueCommand.direction = static_cast(data->args[1]); enhancedMoveToHueCommand.transitionTime = static_cast(data->args[2]); enhancedMoveToHueCommand.optionsMask = static_cast(data->args[3]); enhancedMoveToHueCommand.optionsOverride = static_cast(data->args[4]); @@ -472,7 +474,7 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E break; case Clusters::ColorControl::Commands::EnhancedMoveHue::Id: - enhancedMoveHueCommand.moveMode = static_cast(data->args[0]); + enhancedMoveHueCommand.moveMode = static_cast(data->args[0]); enhancedMoveHueCommand.rate = static_cast(data->args[1]); enhancedMoveHueCommand.optionsMask = static_cast(data->args[2]); enhancedMoveHueCommand.optionsOverride = static_cast(data->args[3]); @@ -481,7 +483,7 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E break; case Clusters::ColorControl::Commands::EnhancedStepHue::Id: - enhancedStepHueCommand.stepMode = static_cast(data->args[0]); + enhancedStepHueCommand.stepMode = static_cast(data->args[0]); enhancedStepHueCommand.stepSize = static_cast(data->args[1]); enhancedStepHueCommand.transitionTime = static_cast(data->args[2]); enhancedStepHueCommand.optionsMask = static_cast(data->args[3]); @@ -521,7 +523,7 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E break; case Clusters::ColorControl::Commands::MoveColorTemperature::Id: - moveColorTemperatureCommand.moveMode = static_cast(data->args[0]); + moveColorTemperatureCommand.moveMode = static_cast(data->args[0]); moveColorTemperatureCommand.rate = static_cast(data->args[1]); moveColorTemperatureCommand.colorTemperatureMinimumMireds = static_cast(data->args[2]); moveColorTemperatureCommand.colorTemperatureMaximumMireds = static_cast(data->args[3]); @@ -532,7 +534,7 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E break; case Clusters::ColorControl::Commands::StepColorTemperature::Id: - stepColorTemperatureCommand.stepMode = static_cast(data->args[0]); + stepColorTemperatureCommand.stepMode = static_cast(data->args[0]); stepColorTemperatureCommand.stepSize = static_cast(data->args[1]); stepColorTemperatureCommand.transitionTime = static_cast(data->args[2]); stepColorTemperatureCommand.colorTemperatureMinimumMireds = static_cast(data->args[3]); @@ -547,6 +549,8 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const EmberBindingTableEntry & binding) { + using namespace Clusters::ColorControl; + Messaging::ExchangeManager & exchangeMgr = Server::GetInstance().GetExchangeManager(); Clusters::ColorControl::Commands::MoveToHue::Type moveToHueCommand; @@ -573,7 +577,7 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb { case Clusters::ColorControl::Commands::MoveToHue::Id: moveToHueCommand.hue = static_cast(data->args[0]); - moveToHueCommand.direction = static_cast(data->args[1]); + moveToHueCommand.direction = static_cast(data->args[1]); moveToHueCommand.transitionTime = static_cast(data->args[2]); moveToHueCommand.optionsMask = static_cast(data->args[3]); moveToHueCommand.optionsOverride = static_cast(data->args[4]); @@ -581,7 +585,7 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb break; case Clusters::ColorControl::Commands::MoveHue::Id: - moveHueCommand.moveMode = static_cast(data->args[0]); + moveHueCommand.moveMode = static_cast(data->args[0]); moveHueCommand.rate = static_cast(data->args[1]); moveHueCommand.optionsMask = static_cast(data->args[2]); moveHueCommand.optionsOverride = static_cast(data->args[3]); @@ -589,7 +593,7 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb break; case Clusters::ColorControl::Commands::StepHue::Id: - stepHueCommand.stepMode = static_cast(data->args[0]); + stepHueCommand.stepMode = static_cast(data->args[0]); stepHueCommand.stepSize = static_cast(data->args[1]); stepHueCommand.transitionTime = static_cast(data->args[2]); stepHueCommand.optionsMask = static_cast(data->args[3]); @@ -606,7 +610,7 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb break; case Clusters::ColorControl::Commands::MoveSaturation::Id: - moveSaturationCommand.moveMode = static_cast(data->args[0]); + moveSaturationCommand.moveMode = static_cast(data->args[0]); moveSaturationCommand.rate = static_cast(data->args[1]); moveSaturationCommand.optionsMask = static_cast(data->args[2]); moveSaturationCommand.optionsOverride = static_cast(data->args[3]); @@ -614,7 +618,7 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb break; case Clusters::ColorControl::Commands::StepSaturation::Id: - stepSaturationCommand.stepMode = static_cast(data->args[0]); + stepSaturationCommand.stepMode = static_cast(data->args[0]); stepSaturationCommand.stepSize = static_cast(data->args[1]); stepSaturationCommand.transitionTime = static_cast(data->args[2]); stepSaturationCommand.optionsMask = static_cast(data->args[3]); @@ -667,7 +671,7 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb case Clusters::ColorControl::Commands::EnhancedMoveToHue::Id: enhancedMoveToHueCommand.enhancedHue = static_cast(data->args[0]); - enhancedMoveToHueCommand.direction = static_cast(data->args[1]); + enhancedMoveToHueCommand.direction = static_cast(data->args[1]); enhancedMoveToHueCommand.transitionTime = static_cast(data->args[2]); enhancedMoveToHueCommand.optionsMask = static_cast(data->args[3]); enhancedMoveToHueCommand.optionsOverride = static_cast(data->args[4]); @@ -675,7 +679,7 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb break; case Clusters::ColorControl::Commands::EnhancedMoveHue::Id: - enhancedMoveHueCommand.moveMode = static_cast(data->args[0]); + enhancedMoveHueCommand.moveMode = static_cast(data->args[0]); enhancedMoveHueCommand.rate = static_cast(data->args[1]); enhancedMoveHueCommand.optionsMask = static_cast(data->args[2]); enhancedMoveHueCommand.optionsOverride = static_cast(data->args[3]); @@ -683,7 +687,7 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb break; case Clusters::ColorControl::Commands::EnhancedStepHue::Id: - enhancedStepHueCommand.stepMode = static_cast(data->args[0]); + enhancedStepHueCommand.stepMode = static_cast(data->args[0]); enhancedStepHueCommand.stepSize = static_cast(data->args[1]); enhancedStepHueCommand.transitionTime = static_cast(data->args[2]); enhancedStepHueCommand.optionsMask = static_cast(data->args[3]); @@ -720,7 +724,7 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb break; case Clusters::ColorControl::Commands::MoveColorTemperature::Id: - moveColorTemperatureCommand.moveMode = static_cast(data->args[0]); + moveColorTemperatureCommand.moveMode = static_cast(data->args[0]); moveColorTemperatureCommand.rate = static_cast(data->args[1]); moveColorTemperatureCommand.colorTemperatureMinimumMireds = static_cast(data->args[2]); moveColorTemperatureCommand.colorTemperatureMaximumMireds = static_cast(data->args[3]); @@ -730,7 +734,7 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb break; case Clusters::ColorControl::Commands::StepColorTemperature::Id: - stepColorTemperatureCommand.stepMode = static_cast(data->args[0]); + stepColorTemperatureCommand.stepMode = static_cast(data->args[0]); stepColorTemperatureCommand.stepSize = static_cast(data->args[1]); stepColorTemperatureCommand.transitionTime = static_cast(data->args[2]); stepColorTemperatureCommand.colorTemperatureMinimumMireds = static_cast(data->args[3]); diff --git a/examples/all-clusters-app/esp32/main/AppTask.cpp b/examples/all-clusters-app/esp32/main/AppTask.cpp index 836e4d8b2b7f02..0b63316c2d53ac 100644 --- a/examples/all-clusters-app/esp32/main/AppTask.cpp +++ b/examples/all-clusters-app/esp32/main/AppTask.cpp @@ -21,7 +21,9 @@ #include "DeviceWithDisplay.h" #include "Globals.h" #include "LEDWidget.h" +#if CONFIG_HAVE_DISPLAY #include "ScreenManager.h" +#endif #include "driver/gpio.h" #include "esp_idf_version.h" #include "esp_log.h" diff --git a/examples/all-clusters-app/esp32/main/BluetoothWidget.cpp b/examples/all-clusters-app/esp32/main/BluetoothWidget.cpp index 4f8a011254bed0..452fb4ff85bb6f 100644 --- a/examples/all-clusters-app/esp32/main/BluetoothWidget.cpp +++ b/examples/all-clusters-app/esp32/main/BluetoothWidget.cpp @@ -23,12 +23,13 @@ * connection on display. */ -#include "ScreenManager.h" - #include "BluetoothWidget.h" #include "esp_log.h" #include "esp_system.h" +#if CONFIG_HAVE_DISPLAY +#include "ScreenManager.h" +#endif extern const char * TAG; diff --git a/examples/all-clusters-app/esp32/main/Button.cpp b/examples/all-clusters-app/esp32/main/Button.cpp index 5708f196b14944..a1930290f6ebad 100644 --- a/examples/all-clusters-app/esp32/main/Button.cpp +++ b/examples/all-clusters-app/esp32/main/Button.cpp @@ -31,7 +31,6 @@ #include "AppTask.h" #include "Button.h" #include "Globals.h" -#include "ScreenManager.h" #include #include #include diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 02d6693e20fecf..144dbd4892af33 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -108,22 +108,15 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}" ) endif (CONFIG_ENABLE_PW_RPC) -if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C2_DEVKITM}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C6_DEVKITC}" STREQUAL "y")) - list(APPEND PRIV_INCLUDE_DIRS_LIST - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include") - set(PRIV_REQUIRES_LIST chip QRCode bt) -elseif(("${CONFIG_DEVICE_TYPE_M5STACK}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_WROVER_KIT}" STREQUAL "y")) - set(PRIV_REQUIRES_LIST chip QRCode bt tft spidrier screen-framework) +set(PRIV_REQUIRES_LIST chip QRCode bt driver app_update nvs_flash spi_flash openthread) +if(CONFIG_HAVE_DISPLAY) + list(APPEND PRIV_REQUIRES_LIST tft spidrier screen-framework) endif() -if("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y") +if(CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM) list(APPEND PRIV_REQUIRES_LIST led_strip) endif() -if (CONFIG_OPENTHREAD_ENABLED) - list(APPEND PRIV_REQUIRES_LIST openthread) -endif() - idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} SRC_DIRS ${SRC_DIRS_LIST} EXCLUDE_SRCS ${EXCLUDE_SRCS_LIST} diff --git a/examples/all-clusters-app/esp32/main/Kconfig.projbuild b/examples/all-clusters-app/esp32/main/Kconfig.projbuild index 8ed41e03971ef3..fb2eb7d6c3b46f 100644 --- a/examples/all-clusters-app/esp32/main/Kconfig.projbuild +++ b/examples/all-clusters-app/esp32/main/Kconfig.projbuild @@ -89,6 +89,11 @@ menu "Demo" default 3 if DEVICE_TYPE_M5STACK default 4 if DEVICE_TYPE_ESP32_WROVER_KIT + config HAVE_DISPLAY + bool + default y if DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT + default n if !(DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT) + config RENDEZVOUS_MODE int range 0 8 diff --git a/examples/all-clusters-app/esp32/main/LEDWidget.cpp b/examples/all-clusters-app/esp32/main/LEDWidget.cpp index 4a95c13b09a46e..9927e490c0d3d4 100644 --- a/examples/all-clusters-app/esp32/main/LEDWidget.cpp +++ b/examples/all-clusters-app/esp32/main/LEDWidget.cpp @@ -24,9 +24,9 @@ */ #include "LEDWidget.h" - +#if CONFIG_HAVE_DISPLAY #include "ScreenManager.h" - +#endif #include "esp_log.h" #include "esp_system.h" #include "esp_timer.h" diff --git a/examples/all-clusters-app/esp32/main/WiFiWidget.cpp b/examples/all-clusters-app/esp32/main/WiFiWidget.cpp index 07fa20d9186fe0..06a47a6f8532c7 100644 --- a/examples/all-clusters-app/esp32/main/WiFiWidget.cpp +++ b/examples/all-clusters-app/esp32/main/WiFiWidget.cpp @@ -23,12 +23,13 @@ * connection on display. */ -#include "ScreenManager.h" - #include "WiFiWidget.h" #include "esp_log.h" #include "esp_system.h" +#if CONFIG_HAVE_DISPLAY +#include "ScreenManager.h" +#endif extern const char * TAG; diff --git a/examples/all-clusters-app/esp32/main/include/BluetoothWidget.h b/examples/all-clusters-app/esp32/main/include/BluetoothWidget.h index 93b636e9b3c083..6bda359f2b755a 100644 --- a/examples/all-clusters-app/esp32/main/include/BluetoothWidget.h +++ b/examples/all-clusters-app/esp32/main/include/BluetoothWidget.h @@ -18,8 +18,6 @@ #pragma once -#include "Display.h" - #include "freertos/FreeRTOS.h" #include "freertos/task.h" diff --git a/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h b/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h index 3dc7b57f2af3fb..f86bce6c870307 100644 --- a/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h +++ b/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h @@ -20,11 +20,8 @@ #include "Button.h" #include "DeviceCallbacks.h" -#include "Display.h" #include "Globals.h" -#include "ListScreen.h" #include "QRCodeScreen.h" -#include "ScreenManager.h" #include "StatusScreen.h" #include "esp_check.h" #include "esp_log.h" @@ -40,6 +37,12 @@ #include #include +#if CONFIG_HAVE_DISPLAY +#include "Display.h" +#include "ListScreen.h" +#include "ScreenManager.h" +#endif + #if CONFIG_DEVICE_TYPE_M5STACK #define BUTTON_1_GPIO_NUM ((gpio_num_t) 39) // Left button on M5Stack #define BUTTON_2_GPIO_NUM ((gpio_num_t) 38) // Middle button on M5Stack diff --git a/examples/all-clusters-app/esp32/main/include/LEDWidget.h b/examples/all-clusters-app/esp32/main/include/LEDWidget.h index 195e44196e2fa7..93e38d4001acc8 100644 --- a/examples/all-clusters-app/esp32/main/include/LEDWidget.h +++ b/examples/all-clusters-app/esp32/main/include/LEDWidget.h @@ -19,8 +19,6 @@ #pragma once -#include "Display.h" - #include "driver/gpio.h" #include "freertos/FreeRTOS.h" diff --git a/examples/all-clusters-app/esp32/main/include/QRCodeScreen.h b/examples/all-clusters-app/esp32/main/include/QRCodeScreen.h index e24fcd86d81e1a..ced5be2ac3a670 100644 --- a/examples/all-clusters-app/esp32/main/include/QRCodeScreen.h +++ b/examples/all-clusters-app/esp32/main/include/QRCodeScreen.h @@ -25,11 +25,11 @@ #pragma once +#include "sdkconfig.h" +#if CONFIG_HAVE_DISPLAY #include "Screen.h" #include "ScreenManager.h" -#if CONFIG_HAVE_DISPLAY - #include #include diff --git a/examples/all-clusters-app/esp32/main/include/StatusScreen.h b/examples/all-clusters-app/esp32/main/include/StatusScreen.h index 621604804aa923..1a72080f8e67ad 100644 --- a/examples/all-clusters-app/esp32/main/include/StatusScreen.h +++ b/examples/all-clusters-app/esp32/main/include/StatusScreen.h @@ -25,10 +25,11 @@ #pragma once -#include "ListScreen.h" -#include "ScreenManager.h" +#include #if CONFIG_HAVE_DISPLAY +#include "ListScreen.h" +#include "ScreenManager.h" #include #include diff --git a/examples/all-clusters-app/esp32/main/include/WiFiWidget.h b/examples/all-clusters-app/esp32/main/include/WiFiWidget.h index 986ab48b63ad4b..5069a2ae5b0f95 100644 --- a/examples/all-clusters-app/esp32/main/include/WiFiWidget.h +++ b/examples/all-clusters-app/esp32/main/include/WiFiWidget.h @@ -18,8 +18,6 @@ #pragma once -#include "Display.h" - #include "freertos/FreeRTOS.h" #include "freertos/task.h" diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index 9274f8063b9b17..8ccacaf941e931 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -12970,7 +12970,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -13066,7 +13066,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "1", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -13130,7 +13130,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -13178,7 +13178,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -13210,7 +13210,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 diff --git a/examples/all-clusters-minimal-app/esp32/main/AppTask.cpp b/examples/all-clusters-minimal-app/esp32/main/AppTask.cpp index 82a8f9757b590d..27c77c94ff90a4 100644 --- a/examples/all-clusters-minimal-app/esp32/main/AppTask.cpp +++ b/examples/all-clusters-minimal-app/esp32/main/AppTask.cpp @@ -21,7 +21,9 @@ #include "DeviceWithDisplay.h" #include "Globals.h" #include "LEDWidget.h" +#if CONFIG_HAVE_DISPLAY #include "ScreenManager.h" +#endif #include "driver/gpio.h" #include "esp_idf_version.h" #include "esp_log.h" diff --git a/examples/all-clusters-minimal-app/esp32/main/BluetoothWidget.cpp b/examples/all-clusters-minimal-app/esp32/main/BluetoothWidget.cpp index 4f8a011254bed0..452fb4ff85bb6f 100644 --- a/examples/all-clusters-minimal-app/esp32/main/BluetoothWidget.cpp +++ b/examples/all-clusters-minimal-app/esp32/main/BluetoothWidget.cpp @@ -23,12 +23,13 @@ * connection on display. */ -#include "ScreenManager.h" - #include "BluetoothWidget.h" #include "esp_log.h" #include "esp_system.h" +#if CONFIG_HAVE_DISPLAY +#include "ScreenManager.h" +#endif extern const char * TAG; diff --git a/examples/all-clusters-minimal-app/esp32/main/Button.cpp b/examples/all-clusters-minimal-app/esp32/main/Button.cpp index 5708f196b14944..dd25966503ba80 100644 --- a/examples/all-clusters-minimal-app/esp32/main/Button.cpp +++ b/examples/all-clusters-minimal-app/esp32/main/Button.cpp @@ -31,7 +31,9 @@ #include "AppTask.h" #include "Button.h" #include "Globals.h" +#if CONFIG_HAVE_DISPLAY #include "ScreenManager.h" +#endif #include #include #include diff --git a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt index 678d19d1940252..e2ed8315f4223f 100644 --- a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt @@ -38,9 +38,9 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/application-basic-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/test-cluster-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fan-control-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fan-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/level-control" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/identify-server" @@ -65,7 +65,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/target-navigator-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-user-interface-configuration-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/channel-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server" @@ -80,8 +80,8 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wake-on-lan-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wake-on-lan-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/pump-configuration-and-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-server" @@ -105,22 +105,15 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}" ) endif (CONFIG_ENABLE_PW_RPC) -if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C2_DEVKITM}" STREQUAL "y")) - list(APPEND PRIV_INCLUDE_DIRS_LIST - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include") - set(PRIV_REQUIRES_LIST chip QRCode bt) -elseif(("${CONFIG_DEVICE_TYPE_M5STACK}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_WROVER_KIT}" STREQUAL "y")) - set(PRIV_REQUIRES_LIST chip QRCode bt tft spidrier screen-framework) +set(PRIV_REQUIRES_LIST chip QRCode bt driver app_update nvs_flash spi_flash openthread) +if(CONFIG_HAVE_DISPLAY) + list(APPEND PRIV_REQUIRES_LIST tft spidrier screen-framework) endif() -if("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y") +if(CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM) list(APPEND PRIV_REQUIRES_LIST led_strip) endif() -if (CONFIG_OPENTHREAD_ENABLED) - list(APPEND PRIV_REQUIRES_LIST openthread) -endif() - idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} SRC_DIRS ${SRC_DIRS_LIST} PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) diff --git a/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild b/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild index 9b5bff48d90a1e..171af4f0ba2c24 100644 --- a/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild +++ b/examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild @@ -81,6 +81,11 @@ menu "Demo" default 3 if DEVICE_TYPE_M5STACK default 4 if DEVICE_TYPE_ESP32_WROVER_KIT + config HAVE_DISPLAY + bool + default y if DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT + default n if !(DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT) + config RENDEZVOUS_MODE int range 0 8 diff --git a/examples/all-clusters-minimal-app/esp32/main/LEDWidget.cpp b/examples/all-clusters-minimal-app/esp32/main/LEDWidget.cpp index 13dcdc4893c2cf..3163afb5a59a05 100644 --- a/examples/all-clusters-minimal-app/esp32/main/LEDWidget.cpp +++ b/examples/all-clusters-minimal-app/esp32/main/LEDWidget.cpp @@ -24,9 +24,9 @@ */ #include "LEDWidget.h" - +#if CONFIG_HAVE_DISPLAY #include "ScreenManager.h" - +#endif #include "esp_log.h" #include "esp_system.h" #include "esp_timer.h" diff --git a/examples/all-clusters-minimal-app/esp32/main/WiFiWidget.cpp b/examples/all-clusters-minimal-app/esp32/main/WiFiWidget.cpp index 07fa20d9186fe0..cafc40cbfabf19 100644 --- a/examples/all-clusters-minimal-app/esp32/main/WiFiWidget.cpp +++ b/examples/all-clusters-minimal-app/esp32/main/WiFiWidget.cpp @@ -23,13 +23,13 @@ * connection on display. */ -#include "ScreenManager.h" - #include "WiFiWidget.h" #include "esp_log.h" #include "esp_system.h" - +#if CONFIG_HAVE_DISPLAY +#include "ScreenManager.h" +#endif extern const char * TAG; void WiFiWidget::Init() diff --git a/examples/all-clusters-minimal-app/esp32/main/include/BluetoothWidget.h b/examples/all-clusters-minimal-app/esp32/main/include/BluetoothWidget.h index 93b636e9b3c083..6bda359f2b755a 100644 --- a/examples/all-clusters-minimal-app/esp32/main/include/BluetoothWidget.h +++ b/examples/all-clusters-minimal-app/esp32/main/include/BluetoothWidget.h @@ -18,8 +18,6 @@ #pragma once -#include "Display.h" - #include "freertos/FreeRTOS.h" #include "freertos/task.h" diff --git a/examples/all-clusters-minimal-app/esp32/main/include/DeviceWithDisplay.h b/examples/all-clusters-minimal-app/esp32/main/include/DeviceWithDisplay.h index 3dc7b57f2af3fb..b9f89e15ee8792 100644 --- a/examples/all-clusters-minimal-app/esp32/main/include/DeviceWithDisplay.h +++ b/examples/all-clusters-minimal-app/esp32/main/include/DeviceWithDisplay.h @@ -20,12 +20,14 @@ #include "Button.h" #include "DeviceCallbacks.h" -#include "Display.h" #include "Globals.h" +#if CONFIG_HAVE_DISPLAY +#include "Display.h" #include "ListScreen.h" #include "QRCodeScreen.h" #include "ScreenManager.h" #include "StatusScreen.h" +#endif #include "esp_check.h" #include "esp_log.h" #include "esp_system.h" diff --git a/examples/all-clusters-minimal-app/esp32/main/include/LEDWidget.h b/examples/all-clusters-minimal-app/esp32/main/include/LEDWidget.h index 8ce4323329854d..a356667da7a489 100644 --- a/examples/all-clusters-minimal-app/esp32/main/include/LEDWidget.h +++ b/examples/all-clusters-minimal-app/esp32/main/include/LEDWidget.h @@ -19,8 +19,6 @@ #pragma once -#include "Display.h" - #include "driver/gpio.h" #include "freertos/FreeRTOS.h" diff --git a/examples/all-clusters-minimal-app/esp32/main/include/QRCodeScreen.h b/examples/all-clusters-minimal-app/esp32/main/include/QRCodeScreen.h index e24fcd86d81e1a..da0ca8de53fe20 100644 --- a/examples/all-clusters-minimal-app/esp32/main/include/QRCodeScreen.h +++ b/examples/all-clusters-minimal-app/esp32/main/include/QRCodeScreen.h @@ -25,10 +25,11 @@ #pragma once -#include "Screen.h" -#include "ScreenManager.h" +#include #if CONFIG_HAVE_DISPLAY +#include "Screen.h" +#include "ScreenManager.h" #include #include diff --git a/examples/all-clusters-minimal-app/esp32/main/include/StatusScreen.h b/examples/all-clusters-minimal-app/esp32/main/include/StatusScreen.h index 621604804aa923..d1f4d9e52a449d 100644 --- a/examples/all-clusters-minimal-app/esp32/main/include/StatusScreen.h +++ b/examples/all-clusters-minimal-app/esp32/main/include/StatusScreen.h @@ -25,10 +25,11 @@ #pragma once -#include "ListScreen.h" -#include "ScreenManager.h" +#include "sdkconfig.h" #if CONFIG_HAVE_DISPLAY +#include "ListScreen.h" +#include "ScreenManager.h" #include #include diff --git a/examples/all-clusters-minimal-app/esp32/main/include/WiFiWidget.h b/examples/all-clusters-minimal-app/esp32/main/include/WiFiWidget.h index 986ab48b63ad4b..5069a2ae5b0f95 100644 --- a/examples/all-clusters-minimal-app/esp32/main/include/WiFiWidget.h +++ b/examples/all-clusters-minimal-app/esp32/main/include/WiFiWidget.h @@ -18,8 +18,6 @@ #pragma once -#include "Display.h" - #include "freertos/FreeRTOS.h" #include "freertos/task.h" diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt index 201e6a8912a388..7797aef19fa233 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt @@ -31,19 +31,10 @@ import androidx.fragment.app.Fragment import chip.setuppayload.SetupPayload import chip.setuppayload.SetupPayloadParser import chip.setuppayload.SetupPayloadParser.UnrecognizedQrCodeException -import com.google.chip.chiptool.attestation.AttestationTestFragment -import com.google.chip.chiptool.clusterclient.clusterinteraction.ClusterInteractionFragment -import com.google.chip.chiptool.clusterclient.MultiAdminClientFragment -import com.google.chip.chiptool.clusterclient.OpCredClientFragment -import com.google.chip.chiptool.clusterclient.BasicClientFragment -import com.google.chip.chiptool.clusterclient.OnOffClientFragment -import com.google.chip.chiptool.clusterclient.SensorClientFragment -import com.google.chip.chiptool.clusterclient.WildcardFragment import com.google.chip.chiptool.provisioning.AddressCommissioningFragment import com.google.chip.chiptool.provisioning.DeviceProvisioningFragment import com.google.chip.chiptool.provisioning.EnterNetworkFragment import com.google.chip.chiptool.provisioning.ProvisionNetworkType -import com.google.chip.chiptool.provisioning.UnpairDeviceFragment import com.google.chip.chiptool.setuppayloadscanner.BarcodeFragment import com.google.chip.chiptool.setuppayloadscanner.CHIPDeviceDetailsFragment import com.google.chip.chiptool.setuppayloadscanner.CHIPDeviceInfo @@ -254,7 +245,5 @@ class CHIPToolActivity : private const val TAG = "CHIPToolActivity" private const val ADDRESS_COMMISSIONING_FRAGMENT_TAG = "address_commissioning_fragment" private const val ARG_PROVISION_NETWORK_TYPE = "provision_network_type" - - var REQUEST_CODE_COMMISSIONING = 0xB003 } } diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt index 7f31b7485ce141..02188301d2ec40 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt @@ -129,8 +129,8 @@ class OnOffClientFragment : Fragment() { showReportMessage(message) } - override fun onSubscriptionEstablished() { - val message = "Subscription for on/off established" + override fun onSubscriptionEstablished(subscriptionId: Long) { + val message = "Subscription for on/off established with subscriptionId: $subscriptionId" Log.v(TAG, message) showMessage(message) } diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt index a7ac8728f814ca..2d4abab5b668e9 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt @@ -181,7 +181,7 @@ class SensorClientFragment : Fragment() { return try { - ChipClient.getDeviceController(requireContext()).shutdownSubscriptions(subscribedDevicePtr) + ChipClient.getDeviceController(requireContext()).shutdownSubscriptions() subscribedDevicePtr = 0 } catch (ex: Exception) { showMessage(R.string.sensor_client_unsubscribe_error_text, ex.toString()) diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt index a482a6170f7766..70d18492f83968 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt @@ -11,6 +11,7 @@ import android.widget.Button import android.widget.EditText import android.widget.Spinner import android.widget.TextView +import android.widget.Toast import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import chip.devicecontroller.ChipDeviceController @@ -28,6 +29,7 @@ import chip.devicecontroller.model.InvokeElement import chip.devicecontroller.model.NodeState import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag +import chip.tlv.TlvReader import chip.tlv.TlvWriter import com.google.chip.chiptool.ChipClient import com.google.chip.chiptool.R @@ -37,6 +39,8 @@ import java.lang.StringBuilder import java.util.Optional import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch +import kotlin.coroutines.resume +import kotlin.coroutines.suspendCoroutine class WildcardFragment : Fragment() { private var _binding: WildcardFragmentBinding? = null @@ -49,6 +53,10 @@ class WildcardFragment : Fragment() { private lateinit var addressUpdateFragment: AddressUpdateFragment + private val attributePath = ArrayList() + private val eventPath = ArrayList() + private val subscribeIdList = ArrayList() + private val reportCallback = object : ReportCallback { override fun onError(attributePath: ChipAttributePath?, eventPath: ChipEventPath?, ex: Exception) { if (attributePath != null) @@ -108,12 +116,42 @@ class WildcardFragment : Fragment() { ): View { _binding = WildcardFragmentBinding.inflate(inflater, container, false) scope = viewLifecycleOwner.lifecycleScope - binding.subscribeBtn.setOnClickListener { scope.launch { showSubscribeDialog(ATTRIBUTE) } } - binding.readBtn.setOnClickListener { scope.launch { showReadDialog(ATTRIBUTE) } } - binding.writeBtn.setOnClickListener { scope.launch { showWriteDialog() } } - binding.subscribeEventBtn.setOnClickListener { scope.launch { showSubscribeDialog(EVENT) } } - binding.readEventBtn.setOnClickListener { scope.launch { showReadDialog(EVENT) } } - binding.invokeBtn.setOnClickListener { scope.launch { showInvokeDialog() } } + + binding.selectTypeRadioGroup.setOnCheckedChangeListener { _, i -> + val readBtnOn = (i == R.id.readRadioBtn) + val subscribeBtnOn = (i == R.id.subscribeRadioBtn) + val writeBtnOn = (i == R.id.writeRadioBtn) + val invokeBtnOn = (i == R.id.invokeRadioBtn) + + binding.addLayout.visibility = getVisibility(readBtnOn || subscribeBtnOn) + binding.attributeIdLabel.visibility = getVisibility(readBtnOn || subscribeBtnOn || writeBtnOn) + binding.attributeIdEd.visibility = getVisibility(readBtnOn || subscribeBtnOn || writeBtnOn) + binding.eventIdLabel.visibility = getVisibility(readBtnOn || subscribeBtnOn) + binding.eventIdEd.visibility = getVisibility(readBtnOn || subscribeBtnOn) + binding.commandIdLabel.visibility = getVisibility(invokeBtnOn) + binding.commandIdEd.visibility = getVisibility(invokeBtnOn) + binding.isUrgentLabel.visibility = getVisibility(subscribeBtnOn) + binding.isUrgentSp.visibility = getVisibility(subscribeBtnOn) + binding.shutdownSubscriptionBtn.visibility = getVisibility(subscribeBtnOn) + } + + binding.sendBtn.setOnClickListener { + if (binding.readRadioBtn.isChecked) { + showReadDialog() + } else if (binding.subscribeRadioBtn.isChecked) { + showSubscribeDialog() + } else if (binding.writeRadioBtn.isChecked) { + showWriteDialog() + } else if (binding.invokeRadioBtn.isChecked) { + showInvokeDialog() + } + } + + binding.shutdownSubscriptionBtn.setOnClickListener { showShutdownSubscriptionDialog() } + + binding.addAttributeBtn.setOnClickListener { addPathList(ATTRIBUTE) } + binding.addEventBtn.setOnClickListener { addPathList(EVENT) } + binding.resetBtn.setOnClickListener { resetPath() } addressUpdateFragment = childFragmentManager.findFragmentById(R.id.addressUpdateFragment) as AddressUpdateFragment @@ -121,6 +159,43 @@ class WildcardFragment : Fragment() { return binding.root } + private fun getVisibility(isShowing: Boolean) : Int { + return if (isShowing) { View.VISIBLE } else { View.GONE } + } + + private fun addPathList(type: Int) { + val endpointId = getChipPathIdForText(binding.endpointIdEd.text.toString()) + val clusterId = getChipPathIdForText(binding.clusterIdEd.text.toString()) + val attributeId = getChipPathIdForText(binding.attributeIdEd.text.toString()) + val eventId = getChipPathIdForText(binding.eventIdEd.text.toString()) + // Only Subscribe used + val isUrgent = (binding.subscribeRadioBtn.isChecked) && (binding.isUrgentSp.selectedItem.toString().toBoolean()) + + if (type == ATTRIBUTE) { + attributePath.add(ChipAttributePath.newInstance(endpointId, clusterId, attributeId)) + } else if (type == EVENT) { + eventPath.add(ChipEventPath.newInstance(endpointId, clusterId, eventId, isUrgent)) + } + updateAddListView() + } + + private fun resetPath() { + attributePath.clear() + eventPath.clear() + updateAddListView() + } + + private fun updateAddListView() { + val builder = StringBuilder() + for (attribute in attributePath) { + builder.append("attribute($attribute)\n") + } + for (event in eventPath) { + builder.append("event($event)\n") + } + binding.sendListView.text = builder.toString() + } + override fun onDestroyView() { super.onDestroyView() _binding = null @@ -154,71 +229,43 @@ class WildcardFragment : Fragment() { return stringBuilder.toString() } - private suspend fun subscribe(type: Int, minInterval: Int, maxInterval: Int, keepSubscriptions: Boolean, isFabricFiltered: Boolean, isUrgent: Boolean) { + private suspend fun subscribe(minInterval: Int, maxInterval: Int, keepSubscriptions: Boolean, isFabricFiltered: Boolean) { val subscriptionEstablishedCallback = - SubscriptionEstablishedCallback { Log.i(TAG, "Subscription to device established") } + SubscriptionEstablishedCallback { + subscriptionId -> + Log.i(TAG, "Subscription to device established : ${subscriptionId.toULong()}") + subscribeIdList.add(subscriptionId.toULong()) + requireActivity().runOnUiThread { + Toast.makeText(requireActivity(), "${getString(R.string.wildcard_subscribe_established_toast_message)} : $subscriptionId", Toast.LENGTH_SHORT).show() + } + } val resubscriptionAttemptCallback = ResubscriptionAttemptCallback { terminationCause, nextResubscribeIntervalMsec -> Log.i(TAG, "ResubscriptionAttempt terminationCause:$terminationCause, nextResubscribeIntervalMsec:$nextResubscribeIntervalMsec") } - val endpointId = getChipPathIdForText(binding.endpointIdEd.text.toString()) - val clusterId = getChipPathIdForText(binding.clusterIdEd.text.toString()) - val attributeId = getChipPathIdForText(binding.attributeIdEd.text.toString()) - val eventId = getChipPathIdForText(binding.eventIdEd.text.toString()) - - if (type == ATTRIBUTE) { - val attributePath = ChipAttributePath.newInstance(endpointId, clusterId, attributeId) - deviceController.subscribeToPath(subscriptionEstablishedCallback, - resubscriptionAttemptCallback, - reportCallback, - ChipClient.getConnectedDevicePointer(requireContext(), - addressUpdateFragment.deviceId), - listOf(attributePath), - null, - minInterval, - maxInterval, - keepSubscriptions, - isFabricFiltered) - } else if (type == EVENT) { - val eventPath = ChipEventPath.newInstance(endpointId, clusterId, eventId, isUrgent) - deviceController.subscribeToPath(subscriptionEstablishedCallback, - resubscriptionAttemptCallback, - reportCallback, - ChipClient.getConnectedDevicePointer(requireContext(), - addressUpdateFragment.deviceId), - null, - listOf(eventPath), - minInterval, - maxInterval, - keepSubscriptions, - isFabricFiltered) - } + deviceController.subscribeToPath(subscriptionEstablishedCallback, + resubscriptionAttemptCallback, + reportCallback, + ChipClient.getConnectedDevicePointer(requireContext(), + addressUpdateFragment.deviceId), + attributePath.ifEmpty { null }, + eventPath.ifEmpty { null }, + minInterval, + maxInterval, + keepSubscriptions, + isFabricFiltered, + /* imTimeoutMs= */ 0) } - private suspend fun read(type: Int, isFabricFiltered: Boolean) { - val endpointId = getChipPathIdForText(binding.endpointIdEd.text.toString()) - val clusterId = getChipPathIdForText(binding.clusterIdEd.text.toString()) - val attributeId = getChipPathIdForText(binding.attributeIdEd.text.toString()) - val eventId = getChipPathIdForText(binding.eventIdEd.text.toString()) - - if (type == ATTRIBUTE) { - val attributePath = ChipAttributePath.newInstance(endpointId, clusterId, attributeId) - deviceController.readPath(reportCallback, - ChipClient.getConnectedDevicePointer(requireContext(), - addressUpdateFragment.deviceId), - listOf(attributePath), - null, - isFabricFiltered) - } else if (type == EVENT) { - val eventPath = ChipEventPath.newInstance(endpointId, clusterId, eventId) - deviceController.readPath(reportCallback, - ChipClient.getConnectedDevicePointer(requireContext(), - addressUpdateFragment.deviceId), - null, - listOf(eventPath), - isFabricFiltered) - } + private suspend fun read(isFabricFiltered: Boolean) { + deviceController.readPath(reportCallback, + ChipClient.getConnectedDevicePointer(requireContext(), + addressUpdateFragment.deviceId), + attributePath.ifEmpty { null }, + eventPath.ifEmpty { null }, + isFabricFiltered, + /* imTimeoutMs= */ 0) } private suspend fun write(writeValueType: String, writeValue: String, dataVersion: Int?, timedRequestTimeoutMs: Int, imTimeoutMs: Int) { @@ -281,7 +328,13 @@ class WildcardFragment : Fragment() { imTimeoutMs) } - private fun showReadDialog(type: Int) { + private fun showReadDialog() { + if (attributePath.isEmpty() && eventPath.isEmpty()) { + requireActivity().runOnUiThread { + Toast.makeText(requireActivity(), R.string.wildcard_empty_error_toast_message, Toast.LENGTH_SHORT).show() + } + return + } val dialogView = requireActivity().layoutInflater.inflate(R.layout.read_dialog, null) val dialog = AlertDialog.Builder(requireContext()).apply { setView(dialogView) @@ -290,7 +343,7 @@ class WildcardFragment : Fragment() { val isFabricFilteredEd = dialogView.findViewById(R.id.isFabricFilteredSp) dialogView.findViewById