diff --git a/examples/all-clusters-app/asr/include/AppTask.h b/examples/all-clusters-app/asr/include/AppTask.h index 210fd5a6fc7032..42cd6ae1541045 100755 --- a/examples/all-clusters-app/asr/include/AppTask.h +++ b/examples/all-clusters-app/asr/include/AppTask.h @@ -19,7 +19,7 @@ #pragma once #include "AppEvent.h" -#include +#include #include #include #include diff --git a/examples/all-clusters-app/infineon/psoc6/include/AppTask.h b/examples/all-clusters-app/infineon/psoc6/include/AppTask.h index 9fade8c82356bf..aa031fe3ba4b52 100644 --- a/examples/all-clusters-app/infineon/psoc6/include/AppTask.h +++ b/examples/all-clusters-app/infineon/psoc6/include/AppTask.h @@ -26,7 +26,7 @@ #include "AppEvent.h" #include "FreeRTOS.h" #include "timers.h" // provides FreeRTOS timer support -#include +#include #include // Application-defined error codes in the CHIP_ERROR space. diff --git a/examples/all-clusters-minimal-app/asr/include/AppTask.h b/examples/all-clusters-minimal-app/asr/include/AppTask.h index 97d1bfe538fb64..7e168e14d5a854 100755 --- a/examples/all-clusters-minimal-app/asr/include/AppTask.h +++ b/examples/all-clusters-minimal-app/asr/include/AppTask.h @@ -24,7 +24,7 @@ #include "AppEvent.h" #include "FreeRTOS.h" #include "timers.h" // provides FreeRTOS timer support -#include +#include #include // Application-defined error codes in the CHIP_ERROR space. diff --git a/examples/all-clusters-minimal-app/infineon/psoc6/include/AppTask.h b/examples/all-clusters-minimal-app/infineon/psoc6/include/AppTask.h index 6dbd906b8104d6..b5102a153e25e1 100644 --- a/examples/all-clusters-minimal-app/infineon/psoc6/include/AppTask.h +++ b/examples/all-clusters-minimal-app/infineon/psoc6/include/AppTask.h @@ -26,7 +26,7 @@ #include "AppEvent.h" #include "FreeRTOS.h" #include "timers.h" // provides FreeRTOS timer support -#include +#include #include // Application-defined error codes in the CHIP_ERROR space. diff --git a/examples/chef/silabs/include/AppTask.h b/examples/chef/silabs/include/AppTask.h index 578d0a17834d29..b6c6d8a271df22 100644 --- a/examples/chef/silabs/include/AppTask.h +++ b/examples/chef/silabs/include/AppTask.h @@ -28,7 +28,7 @@ #include "AppEvent.h" #include "BaseApplication.h" -#include +#include #include #include #include diff --git a/examples/light-switch-app/asr/include/AppTask.h b/examples/light-switch-app/asr/include/AppTask.h index c103fd6f60944e..60525c1975ff43 100755 --- a/examples/light-switch-app/asr/include/AppTask.h +++ b/examples/light-switch-app/asr/include/AppTask.h @@ -25,7 +25,7 @@ #include "FreeRTOS.h" #include "timers.h" // provides FreeRTOS timer support -#include +#include #include // Application-defined error codes in the CHIP_ERROR space. diff --git a/examples/light-switch-app/silabs/include/AppTask.h b/examples/light-switch-app/silabs/include/AppTask.h index a6a74b4605f52c..71ca4b427bad44 100644 --- a/examples/light-switch-app/silabs/include/AppTask.h +++ b/examples/light-switch-app/silabs/include/AppTask.h @@ -28,7 +28,7 @@ #include "AppEvent.h" #include "BaseApplication.h" -#include +#include #include #include #include diff --git a/examples/lighting-app/infineon/psoc6/include/AppTask.h b/examples/lighting-app/infineon/psoc6/include/AppTask.h index 580744cb2fe2d2..4f6f77663d18a4 100644 --- a/examples/lighting-app/infineon/psoc6/include/AppTask.h +++ b/examples/lighting-app/infineon/psoc6/include/AppTask.h @@ -27,7 +27,7 @@ #include "FreeRTOS.h" #include "timers.h" // provides FreeRTOS timer support -#include +#include #include // Application-defined error codes in the CHIP_ERROR space. diff --git a/examples/lighting-app/silabs/include/AppTask.h b/examples/lighting-app/silabs/include/AppTask.h index 450d9c61b719b4..c42415d8868586 100644 --- a/examples/lighting-app/silabs/include/AppTask.h +++ b/examples/lighting-app/silabs/include/AppTask.h @@ -29,7 +29,7 @@ #include "AppEvent.h" #include "BaseApplication.h" #include "LightingManager.h" -#include +#include #include #include #include diff --git a/examples/lit-icd-app/silabs/include/AppTask.h b/examples/lit-icd-app/silabs/include/AppTask.h index 1fc5f2fae5f18c..7866fc48079962 100644 --- a/examples/lit-icd-app/silabs/include/AppTask.h +++ b/examples/lit-icd-app/silabs/include/AppTask.h @@ -28,7 +28,7 @@ #include "AppEvent.h" #include "BaseApplication.h" -#include +#include #include #include #include diff --git a/examples/lock-app/asr/include/AppTask.h b/examples/lock-app/asr/include/AppTask.h index 854d70efdb9744..5c96ea0bec07ae 100755 --- a/examples/lock-app/asr/include/AppTask.h +++ b/examples/lock-app/asr/include/AppTask.h @@ -27,7 +27,7 @@ #include "FreeRTOS.h" #include "timers.h" // provides FreeRTOS timer support -#include +#include #include // Application-defined error codes in the CHIP_ERROR space. diff --git a/examples/lock-app/esp32/main/include/AppTask.h b/examples/lock-app/esp32/main/include/AppTask.h index 3c32cb8704aa0e..32d5dfd199e335 100644 --- a/examples/lock-app/esp32/main/include/AppTask.h +++ b/examples/lock-app/esp32/main/include/AppTask.h @@ -24,7 +24,7 @@ #include #include "freertos/FreeRTOS.h" -#include +#include #include #include diff --git a/examples/lock-app/infineon/psoc6/include/AppTask.h b/examples/lock-app/infineon/psoc6/include/AppTask.h index 8d6ca18b1f8e8a..b120a9c9aec325 100644 --- a/examples/lock-app/infineon/psoc6/include/AppTask.h +++ b/examples/lock-app/infineon/psoc6/include/AppTask.h @@ -27,7 +27,7 @@ #include "FreeRTOS.h" #include "timers.h" // provides FreeRTOS timer support -#include +#include #include // Application-defined error codes in the CHIP_ERROR space. diff --git a/examples/lock-app/qpg/include/AppTask.h b/examples/lock-app/qpg/include/AppTask.h index 3734eeadeef816..b4ede0e6abde0d 100644 --- a/examples/lock-app/qpg/include/AppTask.h +++ b/examples/lock-app/qpg/include/AppTask.h @@ -27,7 +27,7 @@ #include "FreeRTOS.h" #include "timers.h" // provides FreeRTOS timer support -#include +#include #include #include diff --git a/examples/lock-app/silabs/include/AppTask.h b/examples/lock-app/silabs/include/AppTask.h index e1560ac19439b5..b0040ac5bf6586 100644 --- a/examples/lock-app/silabs/include/AppTask.h +++ b/examples/lock-app/silabs/include/AppTask.h @@ -29,7 +29,7 @@ #include "AppEvent.h" #include "BaseApplication.h" #include "LockManager.h" -#include +#include #include #include #include diff --git a/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp b/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp index e03634e9807aa5..2f0bbcbf85b653 100644 --- a/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp +++ b/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp @@ -62,6 +62,10 @@ #include #endif +#ifdef ENABLE_CHIP_SHELL +#include +#endif + using namespace chip; using namespace chip::TLV; using namespace ::chip::Credentials; @@ -202,6 +206,9 @@ CHIP_ERROR chip::NXP::App::AppTaskBase::Init() #if CONFIG_CHIP_WIFI || CHIP_DEVICE_CONFIG_ENABLE_WPA sNetworkCommissioningInstance.Init(); +#ifdef ENABLE_CHIP_SHELL + Shell::SetWiFiDriver(chip::NXP::App::GetAppTask().GetWifiDriverInstance()); +#endif #endif #if CONFIG_CHIP_OTA_REQUESTOR if (err == CHIP_NO_ERROR) diff --git a/examples/platform/silabs/BaseApplication.h b/examples/platform/silabs/BaseApplication.h index e9ca6bfc950834..8a231aa6c51513 100644 --- a/examples/platform/silabs/BaseApplication.h +++ b/examples/platform/silabs/BaseApplication.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/pump-app/silabs/include/AppTask.h b/examples/pump-app/silabs/include/AppTask.h index 69bf7021bf47dd..921ae9a2694475 100644 --- a/examples/pump-app/silabs/include/AppTask.h +++ b/examples/pump-app/silabs/include/AppTask.h @@ -29,7 +29,7 @@ #include "AppEvent.h" #include "BaseApplication.h" #include "PumpManager.h" -#include +#include #include #include #include diff --git a/examples/smoke-co-alarm-app/silabs/include/AppTask.h b/examples/smoke-co-alarm-app/silabs/include/AppTask.h index 9e68505d341a36..0cfd86fa01021a 100644 --- a/examples/smoke-co-alarm-app/silabs/include/AppTask.h +++ b/examples/smoke-co-alarm-app/silabs/include/AppTask.h @@ -27,7 +27,7 @@ #include "AppEvent.h" #include "BaseApplication.h" #include "SmokeCoAlarmManager.h" -#include +#include #include #include #include diff --git a/examples/temperature-measurement-app/asr/include/AppTask.h b/examples/temperature-measurement-app/asr/include/AppTask.h index 97d1bfe538fb64..7e168e14d5a854 100755 --- a/examples/temperature-measurement-app/asr/include/AppTask.h +++ b/examples/temperature-measurement-app/asr/include/AppTask.h @@ -24,7 +24,7 @@ #include "AppEvent.h" #include "FreeRTOS.h" #include "timers.h" // provides FreeRTOS timer support -#include +#include #include // Application-defined error codes in the CHIP_ERROR space. diff --git a/examples/thermostat/asr/include/AppTask.h b/examples/thermostat/asr/include/AppTask.h index 90a8ac65adff46..1bfe23bc1d3692 100644 --- a/examples/thermostat/asr/include/AppTask.h +++ b/examples/thermostat/asr/include/AppTask.h @@ -26,7 +26,7 @@ #include "SensorManager.h" #include "TemperatureManager.h" #include "timers.h" // provides FreeRTOS timer support -#include +#include #include #include diff --git a/examples/thermostat/silabs/include/AppTask.h b/examples/thermostat/silabs/include/AppTask.h index 25177b9ab43808..e41122994237ad 100644 --- a/examples/thermostat/silabs/include/AppTask.h +++ b/examples/thermostat/silabs/include/AppTask.h @@ -34,7 +34,7 @@ #include "BaseApplication.h" #include "SensorManager.h" #include "TemperatureManager.h" -#include +#include #include #include #include diff --git a/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h b/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h index 8c00cf61da4031..dd799bdf8c776d 100644 --- a/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h +++ b/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h @@ -72,7 +72,7 @@ class TargetVideoPlayerInfo public: TargetVideoPlayerInfo() {} - bool operator==(const TargetVideoPlayerInfo & other) { return this->mNodeId == other.mNodeId; } + bool operator==(const TargetVideoPlayerInfo & other) const { return this->mNodeId == other.mNodeId; } bool IsInitialized() { return mInitialized; } void Reset(); diff --git a/examples/window-app/silabs/include/AppTask.h b/examples/window-app/silabs/include/AppTask.h index 268e5eea415a06..ea9f6e5e19868a 100644 --- a/examples/window-app/silabs/include/AppTask.h +++ b/examples/window-app/silabs/include/AppTask.h @@ -27,7 +27,7 @@ #include #include "BaseApplication.h" -#include +#include #include #include #include diff --git a/scripts/helpers/iwyu-check.py b/scripts/helpers/iwyu-check.py index 822b85c184766d..d60a35612679b3 100755 --- a/scripts/helpers/iwyu-check.py +++ b/scripts/helpers/iwyu-check.py @@ -51,42 +51,38 @@ def find_program(names): @click.command() @click.option( '--log-level', - default='INFO', + show_default=True, + default='info', type=click.Choice(__LOG_LEVELS__.keys(), case_sensitive=False), - help='Determines the verbosity of script output.') + help='Set the verbosity of script output.') @click.option( '--no-log-timestamps', default=False, is_flag=True, - help='Skip timestamps in log output') + help='Skip timestamps in log output.') @click.option( '--compile-commands-glob', show_default=True, - default=os.path.join(proj_root_dir, "out", "debug", "compile_commands*.json"), - help='Set global pattern for compile_commands.json files' -) -@click.option( - '--scanning-destination', - show_default=True, - default=os.path.join(proj_root_dir, "src", "platform"), - help='Set scanning destination file(s) or directory /ies in project' -) + default=os.path.join(proj_root_dir, "out", "debug", + "compile_commands*.json"), + help='Set global pattern for compile_commands.json files.') @click.option( '--mapping-file-dir', - help='Set mapping file directory /ies manually. File should have name iwyu.imp' -) + help='Set directory with iwyu.imp mapping file.') @click.option( '--iwyu-args', show_default=True, default="-Xiwyu --no_fwd_decls", - help='Set custom arg(s) for include what you use' -) + help='Set custom arg(s) for include what you use.') @click.option( '--clang-args', default="", - help='Set custom arg(s) for clang' -) -def main(compile_commands_glob, scanning_destination, mapping_file_dir, + help='Set custom arg(s) for clang.') +@click.argument( + 'source', + nargs=-1, + type=click.Path(exists=True)) +def main(compile_commands_glob, source, mapping_file_dir, iwyu_args, clang_args, log_level, no_log_timestamps): # Ensures somewhat pretty logging of what is going on log_fmt = '%(asctime)s %(levelname)-7s %(message)s' @@ -114,8 +110,10 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir, for compile_commands in compile_commands_glob: compile_commands_path = os.path.dirname(compile_commands) - compile_commands_file = os.path.join(compile_commands_path, "compile_commands.json") - logging.debug("Copy compile command file %s to %s", compile_commands, compile_commands_file) + compile_commands_file = os.path.join( + compile_commands_path, "compile_commands.json") + logging.debug("Copy compile command file %s to %s", + compile_commands, compile_commands_file) with contextlib.suppress(shutil.SameFileError): shutil.copyfile(compile_commands, compile_commands_file) @@ -153,14 +151,14 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir, command_arr = [ iwyu, - "-p", compile_commands_path, scanning_destination, + "-p", compile_commands_path, *source, "--", iwyu_args, "-Xiwyu", "--mapping_file=" + mapping_file_dir + "/iwyu.imp", ] + platform_clang_args + [clang_args] logging.info("Used compile commands: %s", compile_commands) logging.info("Scanning includes for platform: %s", platform) - logging.info("Scanning destination: %s", scanning_destination) + logging.info("Scanning sources(s): %s", ", ".join(source)) logging.debug("Command: %s", " ".join(command_arr)) status = subprocess.Popen(" ".join(command_arr), @@ -175,13 +173,13 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir, for line in status.stdout: line = line.rstrip() - if re.match(r"^warning:.*$", line): + if re.search(r"^warning:", line): logger = logging.warning - elif re.match(r"^.*([A-Za-z0-9]+(/[A-Za-z0-9]+)+)\.cpp should [a-zA-Z]+ these lines:$", line): + elif re.search(r"should (add|remove)? these lines:$", line): logger = logging.warning - elif re.match(r"^.*([A-Za-z0-9]+(/[A-Za-z0-9]+)+)\.[a-zA-Z]+ has correct #includes/fwd-decls\)$", line): + elif re.search(r"has correct #includes/fwd-decls\)$", line): logger = logging.info - elif re.match(r"^The full include-list for .*$", line): + elif re.search(r"^The full include-list for", line): logger = logging.warning warning_in_files += 1 @@ -190,7 +188,8 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir, logging.info("============== IWYU output end ================") if warning_in_files: - logging.error("Number of files with include issues: %d", warning_in_files) + logging.error("Number of files with include issues: %d", + warning_in_files) sys.exit(2) else: logging.info("Every include looks good!") diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index 173a68633f6d0e..4e7da8f6d30a7c 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,13 +8,13 @@ "mac-amd64", "windows-amd64" ], - "tags": ["version:2@v2024.03.14-nightly.1"] + "tags": ["version:2@v2024.04.15-nightly.1"] }, { "_comment": "Always get the amd64 version on mac until usable arm64 zap build is available", "path": "fuchsia/third_party/zap/mac-amd64", "platforms": ["mac-arm64"], - "tags": ["version:2@v2024.03.14-nightly.1"] + "tags": ["version:2@v2024.04.15-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index 6f551d6ac92803..cdc8952361f654 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2024.03.14-nightly +v2024.04.15-nightly diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index b5880f761dd41d..3256ba069c2790 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2024.3.14' +MIN_ZAP_VERSION = '2024.4.15' class ZapTool: diff --git a/src/app/ConcreteAttributePath.h b/src/app/ConcreteAttributePath.h index cfde88ab9bd374..03e801bd9b3395 100644 --- a/src/app/ConcreteAttributePath.h +++ b/src/app/ConcreteAttributePath.h @@ -142,7 +142,10 @@ struct ConcreteDataAttributePath : public ConcreteAttributePath ChipLogValueMEI(mClusterId), ChipLogValueMEI(mAttributeId)); } - bool MatchesConcreteAttributePath(const ConcreteAttributePath & aOther) { return ConcreteAttributePath::operator==(aOther); } + bool MatchesConcreteAttributePath(const ConcreteAttributePath & aOther) const + { + return ConcreteAttributePath::operator==(aOther); + } bool operator==(const ConcreteDataAttributePath & aOther) const { diff --git a/src/app/clusters/bindings/PendingNotificationMap.h b/src/app/clusters/bindings/PendingNotificationMap.h index c06a0a426d434c..1b187df74c7e1c 100644 --- a/src/app/clusters/bindings/PendingNotificationMap.h +++ b/src/app/clusters/bindings/PendingNotificationMap.h @@ -88,9 +88,9 @@ class PendingNotificationMap return *this; } - bool operator!=(const Iterator & rhs) { return mIndex != rhs.mIndex; } + bool operator!=(const Iterator & rhs) const { return mIndex != rhs.mIndex; } - bool operator==(const Iterator & rhs) { return mIndex == rhs.mIndex; } + bool operator==(const Iterator & rhs) const { return mIndex == rhs.mIndex; } private: PendingNotificationMap * mMap; diff --git a/src/app/clusters/scenes-server/SceneTable.h b/src/app/clusters/scenes-server/SceneTable.h index 1b634211ead063..6e384609c11057 100644 --- a/src/app/clusters/scenes-server/SceneTable.h +++ b/src/app/clusters/scenes-server/SceneTable.h @@ -149,7 +149,7 @@ class SceneTable bool IsValid() { return (mSceneId != kUndefinedSceneId); } - bool operator==(const SceneStorageId & other) { return (mGroupId == other.mGroupId && mSceneId == other.mSceneId); } + bool operator==(const SceneStorageId & other) const { return (mGroupId == other.mGroupId && mSceneId == other.mSceneId); } }; /// @brief struct used to store data held in a scene @@ -235,7 +235,7 @@ class SceneTable SceneTableEntry(SceneStorageId id) : mStorageId(id) {} SceneTableEntry(const SceneStorageId id, const SceneData data) : mStorageId(id), mStorageData(data) {} - bool operator==(const SceneTableEntry & other) + bool operator==(const SceneTableEntry & other) const { return (mStorageId == other.mStorageId && mStorageData == other.mStorageData); } diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index 57abf8087f59ca..cd9c56f9f021f7 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -27,7 +27,7 @@ #include #if CONFIG_NETWORK_LAYER_BLE -#include +#include #endif #include #include diff --git a/src/app/zap-templates/app-templates.json b/src/app/zap-templates/app-templates.json index 1d41e127165c01..d55bae36312e03 100644 --- a/src/app/zap-templates/app-templates.json +++ b/src/app/zap-templates/app-templates.json @@ -1,6 +1,8 @@ { "name": "CHIP Application templates", "version": "chip-v1", + "requiredFeatureLevel": 102, + "category": "matter", "helpers": [ "partials/helper.js", "common/ListHelper.js", diff --git a/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml index 0668f2dea4ae7c..3532c89b931880 100644 --- a/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml @@ -38,6 +38,11 @@ limitations under the License. ADMINISTRATOR_COMMISSIONING_CLUSTER Commands to trigger a Node to allow a new Administrator to commission it. + + + + + WindowStatus AdminFabricIndex AdminVendorId @@ -64,9 +69,4 @@ limitations under the License. - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/air-quality-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/air-quality-cluster.xml index f2ce941007bf59..bbc57510e85dce 100644 --- a/src/app/zap-templates/zcl/data-model/chip/air-quality-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/air-quality-cluster.xml @@ -25,19 +25,25 @@ limitations under the License. true true + + + + + + + + + + + + + + + AirQuality - - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml index 7a50d97d666b5f..8aaca6201074dd 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml @@ -25,6 +25,12 @@ limitations under the License. true This cluster provides an interface for launching content on a media player device such as a TV or Speaker. + + + + + + CatalogList CurrentApp @@ -75,9 +81,4 @@ limitations under the License. - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml index 2067d048d4e569..acaa9deadb6a3b 100644 --- a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml @@ -24,6 +24,13 @@ limitations under the License. true true This cluster provides an interface for controlling the Output on a media device such as a TV. + + + + + + + OutputList CurrentOutput @@ -58,9 +65,4 @@ limitations under the License. - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/boolean-state-configuration-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/boolean-state-configuration-cluster.xml index 2b5f81eed744e1..f60623455c8d24 100644 --- a/src/app/zap-templates/zcl/data-model/chip/boolean-state-configuration-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/boolean-state-configuration-cluster.xml @@ -17,14 +17,6 @@ limitations under the License. - - - - - - - - @@ -46,6 +38,26 @@ limitations under the License. This cluster is used to configure a boolean sensor. + + + + + + + + + + + + + + + + + + + + CurrentSensitivityLevel SupportedSensitivityLevels DefaultSensitivityLevel diff --git a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml index 460fedd40c89c1..25ec7b7062f97a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml @@ -25,6 +25,22 @@ limitations under the License. true This cluster provides an interface for controlling the current Channel on a device. + + + + + + + + + + + + + + + + ChannelList Lineup CurrentChannel @@ -192,12 +208,4 @@ limitations under the License. - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml index 0dcb76abac44ea..749731069494f5 100644 --- a/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml @@ -15,14 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - - - - - - - - + @@ -107,6 +100,24 @@ limitations under the License. + + + + + + + + + + + + + + + + + + CurrentHue CurrentSaturation diff --git a/src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml index c671c5b3e58373..4d03c539103970 100644 --- a/src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml @@ -29,6 +29,35 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MeasuredValue MinMeasuredValue MaxMeasuredValue @@ -54,6 +83,35 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MeasuredValue MinMeasuredValue @@ -80,6 +138,35 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MeasuredValue MinMeasuredValue MaxMeasuredValue @@ -105,6 +192,35 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MeasuredValue MinMeasuredValue MaxMeasuredValue @@ -130,6 +246,35 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MeasuredValue MinMeasuredValue MaxMeasuredValue @@ -155,6 +300,35 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MeasuredValue MinMeasuredValue MaxMeasuredValue @@ -180,6 +354,35 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MeasuredValue MinMeasuredValue MaxMeasuredValue @@ -205,6 +408,35 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MeasuredValue MinMeasuredValue MaxMeasuredValue @@ -230,6 +462,35 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MeasuredValue MinMeasuredValue MaxMeasuredValue @@ -255,6 +516,35 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MeasuredValue MinMeasuredValue MaxMeasuredValue @@ -268,26 +558,6 @@ limitations under the License. LevelValue - - - - - - - - - - - - - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml index d8077e9e9276cc..06468c114c42dc 100644 --- a/src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml @@ -24,6 +24,25 @@ limitations under the License. true true This cluster is used for managing the content control (including "parental control") settings on a media device such as a TV, or Set-top Box. + + + + + + + + + + + + + + + + + + + Enabled OnDemandRatings OnDemandRatingThreshold @@ -96,13 +115,4 @@ limitations under the License. - - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml index 037998053d512f..3c59ae1f9c90ad 100644 --- a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml @@ -177,11 +177,12 @@ limitations under the License. - - - - - - - + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml index f95d2acb1b2f40..639b965cfc9bf9 100644 --- a/src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml @@ -31,11 +31,6 @@ limitations under the License. - - - - - General Descriptor @@ -45,6 +40,10 @@ limitations under the License. + + + + DeviceTypeList ServerList ClientList diff --git a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml index 85762181765590..3f921f4e554409 100644 --- a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml @@ -16,16 +16,7 @@ limitations under the License. --> - - - - - - - - - - + Device Energy Management @@ -37,6 +28,73 @@ limitations under the License. This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ESAType ESACanGenerate diff --git a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml index b41555e2fe03cd..043fb4a1833502 100644 --- a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml @@ -34,6 +34,13 @@ limitations under the License. true Attributes and commands for selecting a mode from a list of supported options. + + + + + + + SupportedModes CurrentMode diff --git a/src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml index 3dc4ff779bd655..7e41a7a1c03f99 100644 --- a/src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml @@ -37,6 +37,12 @@ limitations under the License. true true + + + + + + Mask Latch State @@ -60,9 +66,4 @@ limitations under the License. - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml index c578c164c0ca0f..436967be2cee89 100644 --- a/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml @@ -33,6 +33,13 @@ limitations under the License. true Attributes and commands for selecting a mode from a list of supported options. + + + + + + + SupportedModes CurrentMode diff --git a/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml index 1c179f9324422a..cc2bf491f25045 100644 --- a/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml @@ -64,6 +64,67 @@ limitations under the License. true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + @@ -815,25 +876,6 @@ limitations under the License. - - - - - - - - - - - - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/drlc-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/drlc-cluster.xml index dce7ff59f3fdac..d64bce1c85b7f6 100644 --- a/src/app/zap-templates/zcl/data-model/chip/drlc-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/drlc-cluster.xml @@ -17,16 +17,6 @@ limitations under the License. - - - - - - - - - - @@ -185,6 +175,30 @@ limitations under the License. true + + + + + + + + + + + + + + + + + + + + + + + + LoadControlPrograms NumberOfLoadControlPrograms Events diff --git a/src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml index 55a298ee596e53..0a4039badf7c97 100644 --- a/src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml @@ -16,13 +16,6 @@ limitations under the License. --> - - - - - - - Electrical Energy Measurement Measurement & Sensing @@ -32,6 +25,22 @@ limitations under the License. true This cluster provides a mechanism for querying data about the electrical energy imported or provided by the server. + + + + + + + + + + + + + + + + Accuracy CumulativeEnergyImported diff --git a/src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml index e723982ee0ffe8..69be8e08570f39 100644 --- a/src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml @@ -16,14 +16,6 @@ limitations under the License. --> - - - - - - - - Electrical Power Measurement Measurement & Sensing @@ -33,6 +25,31 @@ limitations under the License. true This cluster provides a mechanism for querying data about electrical power as measured by the server. + + + + + + + + + + + + + + + + + + + + + + + + + PowerMode NumberOfMeasurementTypes diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index 107cc9cab7b103..cbc0882ac1b3ac 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -96,6 +96,24 @@ limitations under the License. Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. + + + + + + + + + + + + + + + + + + State @@ -224,13 +242,5 @@ limitations under the License. - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml index 4418502ae5e389..22e5562ed33f7f 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml @@ -33,6 +33,13 @@ limitations under the License. true Attributes and commands for selecting a mode from a list of supported options. + + + + + + + SupportedModes CurrentMode diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-preference-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-preference-cluster.xml index 32893bd82a68e9..a5e1ea8e950ae1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-preference-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-preference-cluster.xml @@ -24,6 +24,15 @@ limitations under the License. + + + + + + + + + EnergyBalances @@ -49,12 +58,6 @@ limitations under the License. - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml index 830814b55dd2f3..f2cf3173c68b29 100644 --- a/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml @@ -29,17 +29,22 @@ limitations under the License. - - - - - General Ethernet Network Diagnostics 0x0037 ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. + + + + + + + + + + PHYRate FullDuplex PacketRxCount diff --git a/src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml index c2deff336eae46..6cf763dd30ba26 100644 --- a/src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml @@ -17,16 +17,6 @@ limitations under the License. - - - - - - - - - - @@ -85,6 +75,27 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + FanMode FanModeSequence PercentSetting diff --git a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml index 26e14006a6cca8..26f0e5708dd280 100644 --- a/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml @@ -17,11 +17,6 @@ limitations under the License. - - - - - @@ -90,6 +85,13 @@ limitations under the License. GENERAL_DIAGNOSTICS_CLUSTER The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. + + + + + + + NetworkInterfaces RebootCount + + + + + + + + + + + + + + + + + + + + + + + + + + + IdleModeDuration ActiveModeDuration ActiveModeThreshold diff --git a/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml index d4f6ffbba9a742..b43ace5c0c8383 100644 --- a/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml @@ -25,6 +25,18 @@ limitations under the License. true This cluster provides an interface for controlling a device like a TV using action commands such as UP, DOWN, and SELECT. + + + + + + + + + + + + Upon receipt, this SHALL process a keycode as input to the media device. @@ -140,11 +152,5 @@ limitations under the License. - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml index fff4fdcaac0dfb..99e4ef50c9ca7b 100644 --- a/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml @@ -34,6 +34,13 @@ limitations under the License. true Attributes and commands for selecting a mode from a list of supported options. + + + + + + + SupportedModes CurrentMode diff --git a/src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml index dca3fb6f3532d1..79a7da56a448e0 100644 --- a/src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml @@ -17,12 +17,6 @@ limitations under the License. - - - - - - @@ -54,6 +48,20 @@ limitations under the License. + + + + + + + + + + + + CurrentLevel RemainingTime MinLevel diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index 96ed6fdc2da625..795f7a71cf54bc 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -86,7 +86,18 @@ limitations under the License. - + + + + + + + + + + + + @@ -253,6 +264,11 @@ limitations under the License. CopySceneResponse + + + + + ON_OFF GLOBAL_SCENE_CONTROL ON_TIME @@ -266,6 +282,14 @@ limitations under the License. OnWithTimedOff + + + + + + + + CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME @@ -341,6 +365,11 @@ limitations under the License. CopySceneResponse + + + + + ON_OFF GLOBAL_SCENE_CONTROL ON_TIME @@ -354,6 +383,14 @@ limitations under the License. OnWithTimedOff + + + + + + + + CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME @@ -426,6 +463,11 @@ limitations under the License. CopySceneResponse + + + + + ON_OFF GLOBAL_SCENE_CONTROL ON_TIME @@ -439,6 +481,14 @@ limitations under the License. OnWithTimedOff + + + + + + + + CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME @@ -455,6 +505,11 @@ limitations under the License. StopWithOnOff + + + + + COLOR_CONTROL_REMAINING_TIME COLOR_CONTROL_COLOR_TEMPERATURE COLOR_CONTROL_COLOR_MODE @@ -525,6 +580,11 @@ limitations under the License. GetSceneMembershipResponse + + + + + ON_OFF GLOBAL_SCENE_CONTROL ON_TIME @@ -538,6 +598,14 @@ limitations under the License. OnWithTimedOff + + + + + + + + CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME @@ -554,6 +622,23 @@ limitations under the License. StopWithOnOff + + + + + + + + + + + + + + + + + COLOR_CONTROL_REMAINING_TIME COLOR_CONTROL_CURRENT_X COLOR_CONTROL_CURRENT_Y @@ -628,6 +713,11 @@ limitations under the License. GetSceneMembershipResponse + + + + + ON_OFF GLOBAL_SCENE_CONTROL ON_TIME @@ -641,6 +731,14 @@ limitations under the License. OnWithTimedOff + + + + + + + + CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME @@ -709,6 +807,11 @@ limitations under the License. GetSceneMembershipResponse + + + + + ON_OFF GLOBAL_SCENE_CONTROL ON_TIME @@ -722,6 +825,14 @@ limitations under the License. OnWithTimedOff + + + + + + + + CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME @@ -1377,7 +1488,29 @@ limitations under the License. CLIENT_LIST PARTS_LIST - + + + + + + + + + + + + + + + + + + + + + + + @@ -1457,7 +1590,15 @@ limitations under the License. RemoveAllGroups AddGroupIfIdentifying - + + + + + + + + + @@ -1486,7 +1627,15 @@ limitations under the License. - + + + + + + + + + @@ -1674,7 +1823,13 @@ limitations under the License. - + + + + + + + @@ -1829,7 +1984,13 @@ limitations under the License. - + + + + + + + @@ -1877,6 +2038,11 @@ limitations under the License. Identify + + + + + ON_OFF Off On @@ -1976,10 +2142,22 @@ limitations under the License. Endpoint - + + + + + + + - + + + + + + + @@ -2008,7 +2186,16 @@ limitations under the License. - + + + + + + + + + + @@ -2025,7 +2212,13 @@ limitations under the License. - + + + + + + + @@ -2040,8 +2233,20 @@ limitations under the License. - - + + + + + + + + + + + + + + @@ -2058,8 +2263,20 @@ limitations under the License. - - + + + + + + + + + + + + + + @@ -2078,7 +2295,19 @@ limitations under the License. - + + + + + + + + + + + + + @@ -2110,8 +2339,20 @@ limitations under the License. - - + + + + + + + + + + + + + + @@ -2375,6 +2616,11 @@ limitations under the License. + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml index 028ab467af7c0c..597b285cc1b5dd 100644 --- a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml @@ -26,6 +26,12 @@ limitations under the License. This cluster provides an interface for controlling the Input Selector on a media device such as a TV. + + + + + + InputList CurrentInput @@ -75,9 +81,5 @@ limitations under the License. - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml index 32c2da12ed0780..a77b8fa4befb4c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml @@ -27,6 +27,25 @@ limitations under the License. This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. + + + + + + + + + + + + + + + + + + + CurrentState StartTime Duration @@ -161,14 +180,6 @@ limitations under the License. - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml index 16b1527625d320..741ba801f5c092 100644 --- a/src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml @@ -17,13 +17,6 @@ limitations under the License. - - - - - - - @@ -78,6 +71,26 @@ limitations under the License. true true + + + + + + + + + + + + + + + + + + + + Messages ActiveMessageIDs diff --git a/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml index ab13fc51e10f29..5567bc99461893 100644 --- a/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml @@ -17,12 +17,6 @@ limitations under the License. - - - - - - Microwave Oven Control @@ -32,6 +26,21 @@ limitations under the License. MICROWAVE_OVEN_CONTROL_CLUSTER true true + + + + + + + + + + + + + + + CookTime MaxCookTime PowerSetting diff --git a/src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml index 826d77ecd9f42a..b26f022f3cc9b4 100644 --- a/src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml @@ -32,6 +32,13 @@ limitations under the License. true Attributes and commands for selecting a mode from a list of supported options. + + + + + + + SupportedModes CurrentMode diff --git a/src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml index abacba4bafe631..111df8eca07eff 100644 --- a/src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml @@ -86,17 +86,5 @@ This is because zap does not currently support generating code for clusters that - - - - - - - - - - - - - + diff --git a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml index 0462a48e8bc513..443acb1c955c36 100644 --- a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml @@ -40,6 +40,12 @@ limitations under the License. + + + + + + Attributes and commands for selecting a mode from a list of supported options. Description @@ -59,8 +65,5 @@ limitations under the License. - - - - + diff --git a/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml index 340effa347298d..964923be4f2dfa 100644 --- a/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml @@ -88,14 +88,6 @@ limitations under the License. - - - - - - - - Network Commissioning CHIP @@ -105,6 +97,21 @@ limitations under the License. true true + + + + + + + + + + + + + + + MaxNetworks diff --git a/src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml index b5b5aa913229e8..04dcfed83766e8 100644 --- a/src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml @@ -55,6 +55,33 @@ limitations under the License. Attributes and commands for switching devices between 'On' and 'Off' states. + + + + + + + + + + + + + + + + + + + + + + + + + + + OnOff GlobalSceneControl OnTime @@ -95,10 +122,4 @@ limitations under the License. - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/oven-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/oven-mode-cluster.xml index d97be938d74d2d..2508b4741602b3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/oven-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/oven-mode-cluster.xml @@ -39,6 +39,13 @@ limitations under the License. true Attributes and commands for selecting a mode from a list of supported options. + + + + + + + SupportedModes CurrentMode diff --git a/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml index 913df128cc758e..5701dc6ec61e65 100644 --- a/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml @@ -24,6 +24,25 @@ limitations under the License. true true This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. + + + + + + + + + + + + + + + + + + + Status Order @@ -80,13 +99,6 @@ limitations under the License. - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml index 9eef1e03c6c023..2fdddcbe3560da 100644 --- a/src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml @@ -16,13 +16,7 @@ limitations under the License. --> - - - - - - - + Measurement & Sensing Power Topology @@ -32,6 +26,24 @@ limitations under the License. true true + + + + + + + + + + + + + + + + + + AvailableEndpoints ActiveEndpoints diff --git a/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml index f66c546abd60ce..f9487af7f3a9e2 100644 --- a/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml @@ -25,6 +25,13 @@ limitations under the License. true true + + + + + + + MeasuredValue MinMeasuredValue MaxMeasuredValue @@ -36,8 +43,4 @@ limitations under the License. Scale - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml index 7aa34bc6554b68..74416092e7c7f8 100644 --- a/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml @@ -25,6 +25,31 @@ limitations under the License. true true + + + + + + + + + + + + + + + + + + + + + + + + + MaxPressure MaxSpeed MaxFlow @@ -149,15 +174,5 @@ limitations under the License. - - - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml b/src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml index 21bf7da48bd02e..58fa70163f65ea 100644 --- a/src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml +++ b/src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml @@ -28,6 +28,7 @@ limitations under the License. REFRIGERATOR_ALARM_CLUSTER true true + Mask State Supported diff --git a/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml index a8f9605b81a1bc..e5ff239c18afa6 100644 --- a/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml @@ -32,6 +32,13 @@ limitations under the License. true Attributes and commands for selecting a mode from a list of supported options. + + + + + + + SupportedModes CurrentMode diff --git a/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml index 4be5dbddc12478..66de9ee66cbebd 100644 --- a/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml @@ -25,6 +25,18 @@ limitations under the License. true true + + + + + + + + + + + + Condition DegradationDirection @@ -48,6 +60,18 @@ limitations under the License. true true + + + + + + + + + + + + Condition DegradationDirection @@ -62,14 +86,6 @@ limitations under the License. - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml index 3c8686b6d90fb3..c528759d2a8cb7 100644 --- a/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml @@ -38,6 +38,7 @@ limitations under the License. true Attributes and commands for selecting a mode from a list of supported options. + SupportedModes CurrentMode @@ -62,9 +63,9 @@ limitations under the License. - - - - + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml index f2d24e62ede0f4..f13f86ac2dc97e 100644 --- a/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml @@ -69,9 +69,8 @@ limitations under the License. - - - - - + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/scene.xml b/src/app/zap-templates/zcl/data-model/chip/scene.xml index e16047b9c14c07..0c1189093c4e79 100644 --- a/src/app/zap-templates/zcl/data-model/chip/scene.xml +++ b/src/app/zap-templates/zcl/data-model/chip/scene.xml @@ -51,6 +51,12 @@ limitations under the License. true true + + + + + + LastConfiguredBy SceneTableSize @@ -195,8 +201,4 @@ limitations under the License. - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml index c6827dd1c4bd48..31ae0bba9e7d99 100644 --- a/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml @@ -36,6 +36,15 @@ limitations under the License. + + + + + + + + + ExpressedState SmokeState @@ -148,9 +157,4 @@ limitations under the License. - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml index 41dfb3a156693b..3ac2ba42e8e22e 100644 --- a/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml @@ -30,6 +30,13 @@ limitations under the License. 0x0034 SOFTWARE_DIAGNOSTICS_CLUSTER The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. + + + + + + + ThreadMetrics CurrentHeapFree CurrentHeapUsed @@ -45,8 +52,5 @@ limitations under the License. - - - - + diff --git a/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml index 7df57e3ebd26c1..c5e69b3c51ff39 100644 --- a/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml @@ -30,6 +30,36 @@ Interactions with the switch device are exposed as attributes (for the latching + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NumberOfPositions CurrentPosition MultiPressMax @@ -66,13 +96,5 @@ Interactions with the switch device are exposed as attributes (for the latching - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml index 7509e9b44579cb..da0c0bcee983bb 100644 --- a/src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml @@ -25,6 +25,21 @@ limitations under the License. TEMPERATURE_CONTROL_CLUSTER true true + + + + + + + + + + + + + + + TemperatureSetpoint MinTemperature MaxTemperature @@ -38,10 +53,5 @@ limitations under the License. - - - - - - + diff --git a/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml index 948c0937a3fd10..62e9a6d883516d 100644 --- a/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml @@ -16,20 +16,7 @@ limitations under the License. --> - - - - - - - - - - - - - - + @@ -290,6 +277,57 @@ limitations under the License. true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LocalTemperature diff --git a/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml index e56aeca08f2592..77ec8699615156 100644 --- a/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml @@ -92,6 +92,22 @@ limitations under the License. THREAD_NETWORK_DIAGNOSTICS_CLUSTER The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems + + + + + + + + + + + + + + + + Channel RoutingRole NetworkName @@ -169,11 +185,5 @@ limitations under the License. - - - - - - - + diff --git a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml index 39ba6d316712e3..6ade7abe2e446c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml @@ -23,11 +23,6 @@ limitations under the License. - - - - - @@ -55,6 +50,13 @@ limitations under the License. may have differing preferences for how dates and times are conveyed. As such, Nodes that visually or audibly convey time information need a mechanism by which they can be configured to use a user’s preferred format. + + + + + + + HourFormat diff --git a/src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml index 17271c56352c03..9336a6a944735e 100644 --- a/src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml @@ -17,13 +17,6 @@ limitations under the License. - - - - - - - @@ -106,6 +99,21 @@ limitations under the License. Accurate time is required for a number of reasons, including scheduling, display and validating security materials. + + + + + + + + + + + + + + + UTCTime Granularity TimeSource diff --git a/src/app/zap-templates/zcl/data-model/chip/timer-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/timer-cluster.xml index 1b1156b54e5480..d849313d269a83 100644 --- a/src/app/zap-templates/zcl/data-model/chip/timer-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/timer-cluster.xml @@ -18,10 +18,6 @@ limitations under the License. - - - - @@ -42,6 +38,13 @@ limitations under the License. + + + + + + + SetTime TimeRemaining TimerState diff --git a/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml index febb19ed595e36..fb6238add46a4f 100644 --- a/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml @@ -34,14 +34,18 @@ limitations under the License. user. As such, Nodes that visually or audibly convey measurable values to the user need a mechanism by which they can be configured to use a user’s preferred unit. + + + + + + + TemperatureUnit - - - - + diff --git a/src/app/zap-templates/zcl/data-model/chip/valve-configuration-and-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/valve-configuration-and-control-cluster.xml index 0818b3637c892a..4bb545112be846 100644 --- a/src/app/zap-templates/zcl/data-model/chip/valve-configuration-and-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/valve-configuration-and-control-cluster.xml @@ -17,11 +17,6 @@ limitations under the License. - - - - - @@ -55,6 +50,13 @@ limitations under the License. This cluster is used to configure a valve. + + + + + + + OpenDuration diff --git a/src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml index 69a50f4a7ee8be..2dc01920ae3e37 100644 --- a/src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml @@ -17,11 +17,6 @@ limitations under the License. - - - - - @@ -42,6 +37,15 @@ limitations under the License. + + + + + + + + + SpinSpeeds SpinSpeedCurrent NumberOfRinses diff --git a/src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml index a2d0ca758de91e..33d3f661fd3834 100644 --- a/src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml @@ -47,17 +47,23 @@ limitations under the License. - - - - - + General WiFi Network Diagnostics 0x0036 WIFI_NETWORK_DIAGNOSTICS_CLUSTER The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. + + + + + + + + + + BSSID SecurityType WiFiVersion diff --git a/src/app/zap-templates/zcl/data-model/chip/window-covering.xml b/src/app/zap-templates/zcl/data-model/chip/window-covering.xml index e98329a72812a0..b7224f0fb67ea0 100644 --- a/src/app/zap-templates/zcl/data-model/chip/window-covering.xml +++ b/src/app/zap-templates/zcl/data-model/chip/window-covering.xml @@ -33,6 +33,28 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + Type @@ -211,12 +233,4 @@ limitations under the License. - - - - - - - - diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 5bae212dc6d50c..7213b96cf0e012 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -2,6 +2,7 @@ "description": "Matter SDK ZCL data with some extensions", "category": "matter", "version": 1, + "requiredFeatureLevel": 102, "xmlRoot": [ ".", "./data-model/chip/", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index dcfbaf6986c23c..8a4159e98f7eb8 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -2,6 +2,7 @@ "description": "Matter SDK ZCL data", "category": "matter", "version": 1, + "requiredFeatureLevel": 102, "xmlRoot": [ ".", "./data-model/chip/", diff --git a/src/ble/BLEEndPoint.cpp b/src/ble/BLEEndPoint.cpp index 840a668be0a62a..ba6400fc8a19b7 100644 --- a/src/ble/BLEEndPoint.cpp +++ b/src/ble/BLEEndPoint.cpp @@ -25,22 +25,29 @@ * */ -#include -#include +#define _CHIP_BLE_BLE_H +#include "BLEEndPoint.h" -#include - -#if CONFIG_NETWORK_LAYER_BLE -#include +#include +#include +#include #include -#include #include #include - -#include -#include -#include +#include +#include +#include + +#include "BleApplicationDelegate.h" +#include "BleConfig.h" +#include "BleError.h" +#include "BleLayer.h" +#include "BleLayerDelegate.h" +#include "BlePlatformDelegate.h" +#include "BleRole.h" +#include "BleUUID.h" +#include "BtpEngine.h" // Define below to enable extremely verbose, BLE end point-specific debug logging. #undef CHIP_BLE_END_POINT_DEBUG_LOGGING_ENABLED @@ -1498,5 +1505,3 @@ void BLEEndPoint::HandleUnsubscribeTimeout(chip::System::Layer * systemLayer, vo } /* namespace Ble */ } /* namespace chip */ - -#endif /* CONFIG_NETWORK_LAYER_BLE */ diff --git a/src/ble/BLEEndPoint.h b/src/ble/BLEEndPoint.h index 1bce51e1671419..f027a9c2a9c0e6 100644 --- a/src/ble/BLEEndPoint.h +++ b/src/ble/BLEEndPoint.h @@ -27,10 +27,23 @@ #pragma once +#ifndef _CHIP_BLE_BLE_H +#error "Please include instead!" +#endif + +#include + +#include +#include +#include #include +#include -#include -#include +#include "BleConnectionDelegate.h" +#include "BleLayerDelegate.h" +#include "BlePlatformDelegate.h" +#include "BleRole.h" +#include "BtpEngine.h" namespace chip { namespace Ble { @@ -46,8 +59,6 @@ enum // Forward declarations class BleLayer; class BleEndPointPool; -// BLEEndPoint holds a pointer to BleLayerDelegate for messages, while BleLayerDelegate functions also accepts BLEEndPoint. -class BleLayerDelegate; class DLL_EXPORT BLEEndPoint { diff --git a/src/ble/Ble.h b/src/ble/Ble.h index 65b02d81da1768..171d88a90749f3 100644 --- a/src/ble/Ble.h +++ b/src/ble/Ble.h @@ -28,14 +28,22 @@ #include +// Other includes check for the _CHIP_BLE_BLE_H define to ensure that the BLE +// library is included correctly by others (via Ble.h umbrella header). +#define _CHIP_BLE_BLE_H + #include #include #include #include #include +#include #include #include #include +#include + +#undef _CHIP_BLE_BLE_H /** * @namespace Ble diff --git a/src/ble/BleApplicationDelegate.h b/src/ble/BleApplicationDelegate.h index 2584aeb6b908fd..af45b1145155aa 100644 --- a/src/ble/BleApplicationDelegate.h +++ b/src/ble/BleApplicationDelegate.h @@ -24,10 +24,14 @@ #pragma once -#include +#ifndef _CHIP_BLE_BLE_H +#error "Please include instead!" +#endif #include +#include "BleConfig.h" + namespace chip { namespace Ble { diff --git a/src/ble/BleConnectionDelegate.h b/src/ble/BleConnectionDelegate.h index d5e10d29a9a597..d54a09e3ecb416 100644 --- a/src/ble/BleConnectionDelegate.h +++ b/src/ble/BleConnectionDelegate.h @@ -23,12 +23,16 @@ #pragma once -#include -#include +#ifndef _CHIP_BLE_BLE_H +#error "Please include instead!" +#endif #include #include +#include "BleConfig.h" +#include "BleError.h" + namespace chip { namespace Ble { class BleLayer; diff --git a/src/ble/BleError.cpp b/src/ble/BleError.cpp index 10ff63753796b3..340b2e6e1eda7b 100644 --- a/src/ble/BleError.cpp +++ b/src/ble/BleError.cpp @@ -21,14 +21,10 @@ * This file contains functions for working with BLE Layer errors. */ -#include +#define _CHIP_BLE_BLE_H +#include "BleError.h" -#include - -#if CONFIG_NETWORK_LAYER_BLE - -#include -#include +#include namespace chip { namespace Ble { @@ -140,5 +136,3 @@ bool FormatLayerError(char * buf, uint16_t bufSize, CHIP_ERROR err) } /* namespace Ble */ } /* namespace chip */ - -#endif // CONFIG_NETWORK_LAYER_BLE diff --git a/src/ble/BleError.h b/src/ble/BleError.h index a95681a1b96685..ad4b2cdad29c2b 100644 --- a/src/ble/BleError.h +++ b/src/ble/BleError.h @@ -30,7 +30,11 @@ #pragma once -#include "BleConfig.h" +#ifndef _CHIP_BLE_BLE_H +#error "Please include instead!" +#endif + +#include #include diff --git a/src/ble/BleLayer.cpp b/src/ble/BleLayer.cpp index 0472d70ac28d2c..d4a1e3209610a6 100644 --- a/src/ble/BleLayer.cpp +++ b/src/ble/BleLayer.cpp @@ -50,21 +50,28 @@ * drive BLE data and control input up the stack. */ -#include +#define _CHIP_BLE_BLE_H +#include "BleLayer.h" -#if CONFIG_NETWORK_LAYER_BLE - -#include - -#include -#include -#include -#include -#include +#include +#include #include #include +#include #include +#include +#include + +#include "BLEEndPoint.h" +#include "BleApplicationDelegate.h" +#include "BleConfig.h" +#include "BleConnectionDelegate.h" +#include "BleError.h" +#include "BleLayerDelegate.h" +#include "BlePlatformDelegate.h" +#include "BleRole.h" +#include "BleUUID.h" // Magic values expected in first 2 bytes of valid BLE transport capabilities request or response: #define CAPABILITIES_MSG_CHECK_BYTE_1 0b01100101 @@ -788,5 +795,3 @@ void BleLayer::OnConnectionError(void * appState, CHIP_ERROR err) } /* namespace Ble */ } /* namespace chip */ - -#endif /* CONFIG_NETWORK_LAYER_BLE */ diff --git a/src/ble/BleLayer.h b/src/ble/BleLayer.h index a1c4d191672617..d9480cbf74ff79 100644 --- a/src/ble/BleLayer.h +++ b/src/ble/BleLayer.h @@ -47,21 +47,26 @@ #pragma once -#include +#ifndef _CHIP_BLE_BLE_H +#error "Please include instead!" +#endif -#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include "BleApplicationDelegate.h" +#include "BleConfig.h" +#include "BleConnectionDelegate.h" +#include "BleLayerDelegate.h" +#include "BlePlatformDelegate.h" +#include "BleRole.h" +#include "BleUUID.h" namespace chip { namespace Ble { @@ -78,10 +83,6 @@ namespace Ble { #define CHIP_BLE_TRANSPORT_PROTOCOL_MIN_SUPPORTED_VERSION kBleTransportProtocolVersion_V4 #define CHIP_BLE_TRANSPORT_PROTOCOL_MAX_SUPPORTED_VERSION kBleTransportProtocolVersion_V4 -/// Forward declarations. -class BleLayer; -class BLEEndPoint; - /// Enum defining versions of CHIP over BLE transport protocol. typedef enum { @@ -344,5 +345,3 @@ class DLL_EXPORT BleLayer } /* namespace Ble */ } /* namespace chip */ - -#include "BLEEndPoint.h" diff --git a/src/ble/BleLayerDelegate.h b/src/ble/BleLayerDelegate.h index 63d4243dbeb3b5..cde31569e5a53e 100644 --- a/src/ble/BleLayerDelegate.h +++ b/src/ble/BleLayerDelegate.h @@ -23,15 +23,23 @@ #pragma once -#include -#include -#include -#include +#ifndef _CHIP_BLE_BLE_H +#error "Please include instead!" +#endif + #include +#include "BleConfig.h" +#include "BleError.h" +#include "BleUUID.h" + namespace chip { namespace Ble { +// BLEEndPoint holds a pointer to BleLayerDelegate for messages, +// while BleLayerDelegate functions also accepts BLEEndPoint. +class BLEEndPoint; + class BleLayerDelegate { public: diff --git a/src/ble/BlePlatformDelegate.h b/src/ble/BlePlatformDelegate.h index 3e5e62736d9f65..0db09441bffae0 100644 --- a/src/ble/BlePlatformDelegate.h +++ b/src/ble/BlePlatformDelegate.h @@ -24,13 +24,16 @@ #pragma once -#include - -#include +#ifndef _CHIP_BLE_BLE_H +#error "Please include instead!" +#endif #include #include +#include "BleConfig.h" +#include "BleUUID.h" + namespace chip { namespace Ble { diff --git a/src/ble/BleRole.h b/src/ble/BleRole.h index e228a478f72be3..75e67dd443c73b 100644 --- a/src/ble/BleRole.h +++ b/src/ble/BleRole.h @@ -18,6 +18,10 @@ #pragma once +#ifndef _CHIP_BLE_BLE_H +#error "Please include instead!" +#endif + namespace chip { namespace Ble { diff --git a/src/ble/BleUUID.cpp b/src/ble/BleUUID.cpp index 2311d33aaeb77e..098595fd721e5c 100644 --- a/src/ble/BleUUID.cpp +++ b/src/ble/BleUUID.cpp @@ -15,16 +15,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include -#if CONFIG_NETWORK_LAYER_BLE +#define _CHIP_BLE_BLE_H +#include "BleUUID.h" #include #include #include -#include "BleUUID.h" - namespace chip { namespace Ble { @@ -78,5 +76,3 @@ bool StringToUUID(const char * str, ChipBleUUID & uuid) } /* namespace Ble */ } /* namespace chip */ - -#endif /* CONFIG_NETWORK_LAYER_BLE */ diff --git a/src/ble/BleUUID.h b/src/ble/BleUUID.h index 76fe0f322fec6a..315af9e8c76a32 100644 --- a/src/ble/BleUUID.h +++ b/src/ble/BleUUID.h @@ -15,9 +15,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #pragma once -#include +#ifndef _CHIP_BLE_BLE_H +#error "Please include instead!" +#endif + +#include namespace chip { namespace Ble { diff --git a/src/ble/BtpEngine.cpp b/src/ble/BtpEngine.cpp index cb3ac8ee092e2a..3a11c61ea75de9 100644 --- a/src/ble/BtpEngine.cpp +++ b/src/ble/BtpEngine.cpp @@ -25,15 +25,19 @@ * */ -#include +#define _CHIP_BLE_BLE_H +#include "BtpEngine.h" -#if CONFIG_NETWORK_LAYER_BLE - -#include +#include +#include +#include #include #include #include +#include + +#include "BleError.h" // Define below to enable extremely verbose BLE-specific debug logging. #undef CHIP_BTP_PROTOCOL_ENGINE_DEBUG_LOGGING_ENABLED @@ -576,5 +580,3 @@ void BtpEngine::LogStateDebug() const } /* namespace Ble */ } /* namespace chip */ - -#endif /* CONFIG_NETWORK_LAYER_BLE */ diff --git a/src/ble/BtpEngine.h b/src/ble/BtpEngine.h index 0e1ed33789f513..6c40baf635e8d9 100644 --- a/src/ble/BtpEngine.h +++ b/src/ble/BtpEngine.h @@ -27,13 +27,14 @@ #pragma once -#include -#include +#ifndef _CHIP_BLE_BLE_H +#error "Please include instead!" +#endif -#include +#include +#include -#include -#include +#include #include namespace chip { diff --git a/src/ble/CHIPBleServiceData.h b/src/ble/CHIPBleServiceData.h index 6fbee69b7c268f..050cc76a43bca6 100644 --- a/src/ble/CHIPBleServiceData.h +++ b/src/ble/CHIPBleServiceData.h @@ -23,6 +23,12 @@ #pragma once +#ifndef _CHIP_BLE_BLE_H +#error "Please include instead!" +#endif + +#include + #include namespace chip { diff --git a/src/ble/tests/TestBleErrorStr.cpp b/src/ble/tests/TestBleErrorStr.cpp index 1dcb30e6e9878d..6868532823d950 100644 --- a/src/ble/tests/TestBleErrorStr.cpp +++ b/src/ble/tests/TestBleErrorStr.cpp @@ -28,9 +28,11 @@ #include #include -#include #include +#define _CHIP_BLE_BLE_H +#include + #include using namespace chip; diff --git a/src/ble/tests/TestBleUUID.cpp b/src/ble/tests/TestBleUUID.cpp index 70d95bc0336d63..40e425d623c9a4 100644 --- a/src/ble/tests/TestBleUUID.cpp +++ b/src/ble/tests/TestBleUUID.cpp @@ -24,6 +24,7 @@ * */ +#define _CHIP_BLE_BLE_H #include #include diff --git a/src/ble/tests/TestBtpEngine.cpp b/src/ble/tests/TestBtpEngine.cpp index 945c794bb01559..b799ff40e48f75 100644 --- a/src/ble/tests/TestBtpEngine.cpp +++ b/src/ble/tests/TestBtpEngine.cpp @@ -20,11 +20,13 @@ #include #include -#include -#include #include #include +#define _CHIP_BLE_BLE_H +#include +#include + #include using namespace chip; diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 98e3012a49959f..9103a0ba728156 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -61,7 +61,7 @@ #include #if CONFIG_NETWORK_LAYER_BLE -#include +#include #include #endif diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index b035334764b4a0..5290a26fdfbc47 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -72,7 +72,7 @@ #endif #if CONFIG_NETWORK_LAYER_BLE -#include +#include #endif #include diff --git a/src/controller/CHIPDeviceControllerSystemState.h b/src/controller/CHIPDeviceControllerSystemState.h index 707f1befacec94..8a3be25e591ae0 100644 --- a/src/controller/CHIPDeviceControllerSystemState.h +++ b/src/controller/CHIPDeviceControllerSystemState.h @@ -49,7 +49,7 @@ #endif #if CONFIG_NETWORK_LAYER_BLE -#include +#include #include #endif diff --git a/src/controller/SetUpCodePairer.h b/src/controller/SetUpCodePairer.h index f9dc542f4258a0..e177af7322d391 100644 --- a/src/controller/SetUpCodePairer.h +++ b/src/controller/SetUpCodePairer.h @@ -36,7 +36,7 @@ #include #if CONFIG_NETWORK_LAYER_BLE -#include +#include #endif // CONFIG_NETWORK_BLE #include diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp index b62ece066013ca..83c0d029d8ddb7 100644 --- a/src/controller/java/CHIPDeviceController-JNI.cpp +++ b/src/controller/java/CHIPDeviceController-JNI.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/controller/python/chip/ble/LinuxImpl.cpp b/src/controller/python/chip/ble/LinuxImpl.cpp index c61431bd8f9ecd..4e03d41e14949c 100644 --- a/src/controller/python/chip/ble/LinuxImpl.cpp +++ b/src/controller/python/chip/ble/LinuxImpl.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/controller/python/chip/ble/darwin/Scanning.mm b/src/controller/python/chip/ble/darwin/Scanning.mm index d3fb928790ab3e..292978b424a787 100644 --- a/src/controller/python/chip/ble/darwin/Scanning.mm +++ b/src/controller/python/chip/ble/darwin/Scanning.mm @@ -1,5 +1,4 @@ -#include -#include +#include #include #include #include diff --git a/src/credentials/FabricTable.h b/src/credentials/FabricTable.h index c61b6176fecb1e..55c1f6965e8c32 100644 --- a/src/credentials/FabricTable.h +++ b/src/credentials/FabricTable.h @@ -298,7 +298,7 @@ class ConstFabricIterator return GetCurrent(); } - bool operator==(const ConstFabricIterator & other) + bool operator==(const ConstFabricIterator & other) const { if (IsAtEnd()) { @@ -308,7 +308,7 @@ class ConstFabricIterator // Pending entry does not participate in finding this. return (mStart == other.mStart) && (mIndex == other.mIndex) && (mMaxSize == other.mMaxSize); } - bool operator!=(const ConstFabricIterator & other) { return !(*this == other); } + bool operator!=(const ConstFabricIterator & other) const { return !(*this == other); } bool IsAtEnd() const { return (mIndex == mMaxSize); } diff --git a/src/credentials/GroupDataProvider.h b/src/credentials/GroupDataProvider.h index 71e55e0e550cd3..7b6f8f2096e800 100644 --- a/src/credentials/GroupDataProvider.h +++ b/src/credentials/GroupDataProvider.h @@ -72,7 +72,7 @@ class GroupDataProvider Platform::CopyString(name, groupName); } } - bool operator==(const GroupInfo & other) + bool operator==(const GroupInfo & other) const { return (this->group_id == other.group_id) && !strncmp(this->name, other.name, kGroupNameMax); } @@ -151,7 +151,7 @@ class GroupDataProvider // Number of keys present uint8_t num_keys_used = 0; - bool operator==(const KeySet & other) + bool operator==(const KeySet & other) const { VerifyOrReturnError(this->policy == other.policy && this->num_keys_used == other.num_keys_used, false); return !memcmp(this->epoch_keys, other.epoch_keys, this->num_keys_used * sizeof(EpochKey)); diff --git a/src/include/platform/CHIPDeviceEvent.h b/src/include/platform/CHIPDeviceEvent.h index dae127ceba1f06..9d4f293cd3c3b0 100644 --- a/src/include/platform/CHIPDeviceEvent.h +++ b/src/include/platform/CHIPDeviceEvent.h @@ -369,7 +369,7 @@ typedef void (*AsyncWorkFunct)(intptr_t arg); #include CHIPDEVICEPLATFORMEVENT_HEADER #endif // defined(CHIP_DEVICE_LAYER_TARGET) -#include +#include #include #include #include diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index 5699caf1a1ef5b..817019b3c1c63c 100644 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -182,6 +182,7 @@ class ConnectivityManager void MaintainOnDemandWiFiAP(); System::Clock::Timeout GetWiFiAPIdleTimeout(); void SetWiFiAPIdleTimeout(System::Clock::Timeout val); + CHIP_ERROR DisconnectNetwork(); // Thread Methods bool IsThreadEnabled(); @@ -560,5 +561,10 @@ inline void ConnectivityManager::OnWiFiStationProvisionChange() static_cast(this)->_OnWiFiStationProvisionChange(); } +inline CHIP_ERROR ConnectivityManager::DisconnectNetwork() +{ + return static_cast(this)->_DisconnectNetwork(); +} + } // namespace DeviceLayer } // namespace chip diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.ipp b/src/include/platform/internal/GenericConfigurationManagerImpl.ipp index 955b782a3238ed..9b36f341042aa9 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.ipp +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.ipp @@ -27,7 +27,7 @@ #define GENERIC_CONFIGURATION_MANAGER_IMPL_CPP #include -#include +#include #include #include #include diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl.h b/src/include/platform/internal/GenericConnectivityManagerImpl.h index a56e92d17d0d8d..c2aa896bf06411 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl.h @@ -46,6 +46,7 @@ class GenericConnectivityManagerImpl void _SetUserSelectedMode(bool val); uint16_t _GetUserSelectedModeTimeout(); void _SetUserSelectedModeTimeout(uint16_t val); + CHIP_ERROR _DisconnectNetwork(); private: ImplClass * Impl() { return static_cast(this); } @@ -71,6 +72,12 @@ template inline void GenericConnectivityManagerImpl::_SetUserSelectedModeTimeout(uint16_t val) {} +template +inline CHIP_ERROR GenericConnectivityManagerImpl::_DisconnectNetwork() +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/lib/core/CHIPCore.h b/src/lib/core/CHIPCore.h index bac6e473f39d43..6d223b2040057b 100644 --- a/src/lib/core/CHIPCore.h +++ b/src/lib/core/CHIPCore.h @@ -29,10 +29,8 @@ #include -#include - #if CONFIG_NETWORK_LAYER_BLE -#include +#include #endif // CONFIG_NETWORK_LAYER_BLE #define CHIP_CORE_IDENTITY "chip-core" diff --git a/src/lib/shell/commands/BUILD.gn b/src/lib/shell/commands/BUILD.gn index d4dd5820ad7f7a..f3da2760f641b1 100644 --- a/src/lib/shell/commands/BUILD.gn +++ b/src/lib/shell/commands/BUILD.gn @@ -36,7 +36,10 @@ source_set("commands") { } if (chip_enable_wifi) { - sources += [ "WiFi.cpp" ] + sources += [ + "WiFi.cpp", + "WiFi.h", + ] } if (chip_enable_ble && chip_device_platform != "none") { diff --git a/src/lib/shell/commands/WiFi.cpp b/src/lib/shell/commands/WiFi.cpp index 9bd891f20430da..35ab5e26ae23a2 100644 --- a/src/lib/shell/commands/WiFi.cpp +++ b/src/lib/shell/commands/WiFi.cpp @@ -18,17 +18,22 @@ #include #include #include +#include #include +#include #include #include +#include using chip::DeviceLayer::ConnectivityManager; using chip::DeviceLayer::ConnectivityMgr; +using namespace chip::DeviceLayer::NetworkCommissioning; namespace chip { namespace Shell { -static chip::Shell::Engine sShellWiFiSubCommands; +static Shell::Engine sShellWiFiSubCommands; +static DeviceLayer::NetworkCommissioning::WiFiDriver * sDriver; static CHIP_ERROR WiFiHelpHandler(int argc, char ** argv) { @@ -104,13 +109,38 @@ static CHIP_ERROR WiFiModeHandler(int argc, char ** argv) static CHIP_ERROR WiFiConnectHandler(int argc, char ** argv) { - if (argc != 2) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } + CHIP_ERROR error = CHIP_NO_ERROR; + uint8_t networkIndex; + char debugBuffer[CHIP_CONFIG_NETWORK_COMMISSIONING_DEBUG_TEXT_BUFFER_SIZE]; + MutableCharSpan debugText(debugBuffer); + + VerifyOrReturnError(GetWiFiDriver() != nullptr, CHIP_ERROR_NOT_IMPLEMENTED); + + /* Command accepts running with SSID and password as parameters */ + VerifyOrReturnError((argc == 2), CHIP_ERROR_INVALID_ARGUMENT); + + ByteSpan ssidSpan = ByteSpan(Uint8::from_const_char(argv[0]), strlen(argv[0])); + ByteSpan passwordSpan = ByteSpan(Uint8::from_const_char(argv[1]), strlen(argv[1])); + + VerifyOrReturnError(IsSpanUsable(ssidSpan) && IsSpanUsable(passwordSpan), CHIP_ERROR_INVALID_ARGUMENT); + + ChipLogProgress(Shell, "Adding/Updating network %s", argv[0]); + + /* AddOrUpdateNetwork() checks ssid length and password length. The network info is not persistent. */ + GetWiFiDriver()->AddOrUpdateNetwork(ssidSpan, passwordSpan, debugText, networkIndex); + + ChipLogProgress(Shell, "Connecting to network"); + /* Connection event will be returned in OnWiFiConnectivityChange from DeviceCallbacks.cpp */ + GetWiFiDriver()->ConnectNetwork(ssidSpan, nullptr); - // TODO:Provision WiFi using WirelessDriver - return CHIP_ERROR_NOT_IMPLEMENTED; + return error; +} + +static CHIP_ERROR WiFiDisconnectHandler(int argc, char ** argv) +{ + VerifyOrReturnError((argc == 0), CHIP_ERROR_INVALID_ARGUMENT); + + return ConnectivityMgr().DisconnectNetwork(); } static CHIP_ERROR WiFiDispatch(int argc, char ** argv) @@ -122,13 +152,24 @@ static CHIP_ERROR WiFiDispatch(int argc, char ** argv) return sShellWiFiSubCommands.ExecCommand(argc, argv); } +void SetWiFiDriver(WiFiDriver * driver) +{ + sDriver = driver; +} + +WiFiDriver * GetWiFiDriver() +{ + return sDriver; +} + void RegisterWiFiCommands() { /// Subcommands for root command: `device ` static const shell_command_t sWiFiSubCommands[] = { { &WiFiHelpHandler, "help", "" }, - { &WiFiModeHandler, "mode", "Get/Set wifi mode. Usage: wifi mode [disable|ap|sta]." }, - { &WiFiConnectHandler, "connect", "Connect to AP. Usage: wifi connect ssid psk." }, + { &WiFiModeHandler, "mode", "Get/Set wifi mode. Usage: wifi mode [disable|ap|sta]" }, + { &WiFiConnectHandler, "connect", "Connect to AP. Usage: wifi connect " }, + { &WiFiDisconnectHandler, "disconnect", "Disconnect device from AP. Usage: wifi disconnect" }, }; static const shell_command_t sWiFiCommand = { &WiFiDispatch, "wifi", "Usage: wifi " }; diff --git a/src/lib/shell/commands/WiFi.h b/src/lib/shell/commands/WiFi.h new file mode 100644 index 00000000000000..858a960f5b11d0 --- /dev/null +++ b/src/lib/shell/commands/WiFi.h @@ -0,0 +1,35 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Header that defines default shell commands for CHIP examples + */ + +#pragma once + +#include +#include + +namespace chip { +namespace Shell { + +void SetWiFiDriver(DeviceLayer::NetworkCommissioning::WiFiDriver * driver); +DeviceLayer::NetworkCommissioning::WiFiDriver * GetWiFiDriver(); + +} // namespace Shell +} // namespace chip diff --git a/src/platform/ASR/BLEAppSvc.cpp b/src/platform/ASR/BLEAppSvc.cpp index 124a58a3c5a188..d56485df2238cd 100644 --- a/src/platform/ASR/BLEAppSvc.cpp +++ b/src/platform/ASR/BLEAppSvc.cpp @@ -39,7 +39,7 @@ extern "C" { } #endif #include "BLEAppSvc.h" -#include +#include #include #include using namespace chip::DeviceLayer; diff --git a/src/platform/ASR/BLEManagerImpl.cpp b/src/platform/ASR/BLEManagerImpl.cpp index e960a617b4e33b..88f7460a962a3a 100644 --- a/src/platform/ASR/BLEManagerImpl.cpp +++ b/src/platform/ASR/BLEManagerImpl.cpp @@ -23,7 +23,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE #include "BLEAppSvc.h" -#include +#include #include #include #include diff --git a/src/platform/Ameba/BLEManagerImpl.cpp b/src/platform/Ameba/BLEManagerImpl.cpp index 969febfffb5842..2d0a6d99515367 100644 --- a/src/platform/Ameba/BLEManagerImpl.cpp +++ b/src/platform/Ameba/BLEManagerImpl.cpp @@ -30,7 +30,7 @@ #include #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include +#include #include "stdio.h" #include "timers.h" diff --git a/src/platform/Beken/BLEManagerImpl.cpp b/src/platform/Beken/BLEManagerImpl.cpp index 3437a16acfdb79..37f9fea9b9106e 100644 --- a/src/platform/Beken/BLEManagerImpl.cpp +++ b/src/platform/Beken/BLEManagerImpl.cpp @@ -30,7 +30,7 @@ #include #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include +#include #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING #include #endif diff --git a/src/platform/Darwin/BLEManagerImpl.cpp b/src/platform/Darwin/BLEManagerImpl.cpp index 639e8d1e1c4657..c0af6ccf17d93e 100644 --- a/src/platform/Darwin/BLEManagerImpl.cpp +++ b/src/platform/Darwin/BLEManagerImpl.cpp @@ -23,7 +23,7 @@ */ #include -#include +#include #include #include #include diff --git a/src/platform/Darwin/BleApplicationDelegate.h b/src/platform/Darwin/BleApplicationDelegate.h index 662b43b7b53c97..72aba4e65b397b 100644 --- a/src/platform/Darwin/BleApplicationDelegate.h +++ b/src/platform/Darwin/BleApplicationDelegate.h @@ -17,7 +17,7 @@ #pragma once -#include +#include namespace chip { namespace DeviceLayer { diff --git a/src/platform/Darwin/BleApplicationDelegateImpl.mm b/src/platform/Darwin/BleApplicationDelegateImpl.mm index c61f17a894d7c1..883f2a2bcd8916 100644 --- a/src/platform/Darwin/BleApplicationDelegateImpl.mm +++ b/src/platform/Darwin/BleApplicationDelegateImpl.mm @@ -24,7 +24,7 @@ #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). #endif -#include +#include #include using namespace ::chip; diff --git a/src/platform/Darwin/BleConnectionDelegate.h b/src/platform/Darwin/BleConnectionDelegate.h index de97ac383729c1..1441f60610c822 100644 --- a/src/platform/Darwin/BleConnectionDelegate.h +++ b/src/platform/Darwin/BleConnectionDelegate.h @@ -17,7 +17,7 @@ #pragma once -#include +#include namespace chip { namespace DeviceLayer { diff --git a/src/platform/Darwin/BleConnectionDelegateImpl.mm b/src/platform/Darwin/BleConnectionDelegateImpl.mm index 8ec68fc35ea8f4..b325d079ba61a5 100644 --- a/src/platform/Darwin/BleConnectionDelegateImpl.mm +++ b/src/platform/Darwin/BleConnectionDelegateImpl.mm @@ -25,10 +25,7 @@ #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). #endif -#include -#include -#include -#include +#include #include #include #include diff --git a/src/platform/Darwin/BlePlatformDelegate.h b/src/platform/Darwin/BlePlatformDelegate.h index 80b3dfff2d6e73..389a0bf28bce98 100644 --- a/src/platform/Darwin/BlePlatformDelegate.h +++ b/src/platform/Darwin/BlePlatformDelegate.h @@ -17,7 +17,7 @@ #pragma once -#include +#include #include using ::chip::Ble::ChipBleUUID; diff --git a/src/platform/Darwin/BlePlatformDelegateImpl.mm b/src/platform/Darwin/BlePlatformDelegateImpl.mm index 9b30cc7edcc843..210cd872318056 100644 --- a/src/platform/Darwin/BlePlatformDelegateImpl.mm +++ b/src/platform/Darwin/BlePlatformDelegateImpl.mm @@ -25,10 +25,7 @@ #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). #endif -#include -#include -#include -#include +#include #include #include diff --git a/src/platform/Darwin/BleScannerDelegate.h b/src/platform/Darwin/BleScannerDelegate.h index 7759abbb4ba87c..9c96445145d67f 100644 --- a/src/platform/Darwin/BleScannerDelegate.h +++ b/src/platform/Darwin/BleScannerDelegate.h @@ -18,7 +18,7 @@ #pragma once -#include +#include #include namespace chip { diff --git a/src/platform/Darwin/UUIDHelper.h b/src/platform/Darwin/UUIDHelper.h index 40ff15b927a04f..bf12cf9a92375e 100644 --- a/src/platform/Darwin/UUIDHelper.h +++ b/src/platform/Darwin/UUIDHelper.h @@ -17,7 +17,7 @@ #pragma once -#include +#include #import diff --git a/src/platform/ESP32/BLEManagerImpl.h b/src/platform/ESP32/BLEManagerImpl.h index aa740295d03eed..39cde57dc0c262 100644 --- a/src/platform/ESP32/BLEManagerImpl.h +++ b/src/platform/ESP32/BLEManagerImpl.h @@ -68,8 +68,7 @@ struct ble_gatt_char_context #include "ble/Ble.h" #if CONFIG_ENABLE_ESP32_BLE_CONTROLLER -#include -#include +#include #include #endif diff --git a/src/platform/ESP32/ChipDeviceScanner.h b/src/platform/ESP32/ChipDeviceScanner.h index a7718d09a8188f..601e1ac6bab0b0 100644 --- a/src/platform/ESP32/ChipDeviceScanner.h +++ b/src/platform/ESP32/ChipDeviceScanner.h @@ -17,7 +17,6 @@ #pragma once -#include #include #include @@ -32,7 +31,7 @@ #include "esp_gattc_api.h" #include "esp_log.h" #include "freertos/FreeRTOS.h" -#include +#include #include #include #endif diff --git a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp index 06c95b3b45f153..e5d9077ee63ae2 100644 --- a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp +++ b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp @@ -35,9 +35,8 @@ #if CONFIG_BT_BLUEDROID_ENABLED #if CONFIG_ENABLE_ESP32_BLE_CONTROLLER -#include +#include #endif -#include #include #include #include diff --git a/src/platform/ESP32/nimble/BLEManagerImpl.cpp b/src/platform/ESP32/nimble/BLEManagerImpl.cpp index 5407e9969b50e3..edff1666e6311a 100644 --- a/src/platform/ESP32/nimble/BLEManagerImpl.cpp +++ b/src/platform/ESP32/nimble/BLEManagerImpl.cpp @@ -31,9 +31,8 @@ #if CONFIG_BT_NIMBLE_ENABLED #if CONFIG_ENABLE_ESP32_BLE_CONTROLLER -#include +#include #endif -#include #include #include #include diff --git a/src/platform/Infineon/CYW30739/BLEManagerImpl.cpp b/src/platform/Infineon/CYW30739/BLEManagerImpl.cpp index 40428c16ba2853..ab4deef1f91924 100644 --- a/src/platform/Infineon/CYW30739/BLEManagerImpl.cpp +++ b/src/platform/Infineon/CYW30739/BLEManagerImpl.cpp @@ -28,7 +28,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include +#include #include #include #include diff --git a/src/platform/Infineon/PSOC6/BLEManagerImpl.cpp b/src/platform/Infineon/PSOC6/BLEManagerImpl.cpp index 917cdc267e4d24..cb2b01197669e7 100644 --- a/src/platform/Infineon/PSOC6/BLEManagerImpl.cpp +++ b/src/platform/Infineon/PSOC6/BLEManagerImpl.cpp @@ -28,7 +28,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include +#include #include #include #include diff --git a/src/platform/Linux/BLEManagerImpl.cpp b/src/platform/Linux/BLEManagerImpl.cpp index 7f0ad2bcd54212..aeb853efb359c7 100644 --- a/src/platform/Linux/BLEManagerImpl.cpp +++ b/src/platform/Linux/BLEManagerImpl.cpp @@ -35,8 +35,7 @@ #include #include -#include -#include +#include #include #include #include diff --git a/src/platform/Linux/BLEManagerImpl.h b/src/platform/Linux/BLEManagerImpl.h index 4432c106b3bc35..8444439c27c1c7 100644 --- a/src/platform/Linux/BLEManagerImpl.h +++ b/src/platform/Linux/BLEManagerImpl.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include "bluez/BluezAdvertisement.h" diff --git a/src/platform/Linux/bluez/BluezAdvertisement.cpp b/src/platform/Linux/bluez/BluezAdvertisement.cpp index f2855b24629290..c68d601d241cd0 100644 --- a/src/platform/Linux/bluez/BluezAdvertisement.cpp +++ b/src/platform/Linux/bluez/BluezAdvertisement.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/platform/Linux/bluez/BluezAdvertisement.h b/src/platform/Linux/bluez/BluezAdvertisement.h index f1ee9aee21e15d..fcae7713a43efc 100644 --- a/src/platform/Linux/bluez/BluezAdvertisement.h +++ b/src/platform/Linux/bluez/BluezAdvertisement.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/platform/Linux/bluez/BluezEndpoint.cpp b/src/platform/Linux/bluez/BluezEndpoint.cpp index f7b7bc66f85a0b..151c09e09f662d 100644 --- a/src/platform/Linux/bluez/BluezEndpoint.cpp +++ b/src/platform/Linux/bluez/BluezEndpoint.cpp @@ -57,7 +57,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/platform/Linux/bluez/BluezEndpoint.h b/src/platform/Linux/bluez/BluezEndpoint.h index 938e558198384d..01821bf11c6507 100644 --- a/src/platform/Linux/bluez/BluezEndpoint.h +++ b/src/platform/Linux/bluez/BluezEndpoint.h @@ -52,7 +52,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/platform/Linux/bluez/BluezObjectManager.cpp b/src/platform/Linux/bluez/BluezObjectManager.cpp index 91a2ffb2bcd929..ff125c068d3f7e 100644 --- a/src/platform/Linux/bluez/BluezObjectManager.cpp +++ b/src/platform/Linux/bluez/BluezObjectManager.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.cpp b/src/platform/Linux/bluez/ChipDeviceScanner.cpp index 28a9baa358b33f..dcb113b7f479c9 100644 --- a/src/platform/Linux/bluez/ChipDeviceScanner.cpp +++ b/src/platform/Linux/bluez/ChipDeviceScanner.cpp @@ -23,7 +23,7 @@ #include -#include +#include #include #include #include diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.h b/src/platform/Linux/bluez/ChipDeviceScanner.h index ead9467fdc29ef..274af60d32d442 100644 --- a/src/platform/Linux/bluez/ChipDeviceScanner.h +++ b/src/platform/Linux/bluez/ChipDeviceScanner.h @@ -21,7 +21,7 @@ #include -#include +#include #include #include #include diff --git a/src/platform/Tizen/BLEManagerImpl.cpp b/src/platform/Tizen/BLEManagerImpl.cpp index 4d4c3e77316fc7..a78efd9c944cce 100644 --- a/src/platform/Tizen/BLEManagerImpl.cpp +++ b/src/platform/Tizen/BLEManagerImpl.cpp @@ -47,7 +47,6 @@ #include #include -#include #include #include #include diff --git a/src/platform/Tizen/BLEManagerImpl.h b/src/platform/Tizen/BLEManagerImpl.h index 1a49b9dae6c33f..ed30b92aa958b7 100644 --- a/src/platform/Tizen/BLEManagerImpl.h +++ b/src/platform/Tizen/BLEManagerImpl.h @@ -33,7 +33,6 @@ #include #include -#include #include #include #include diff --git a/src/platform/Tizen/ChipDeviceScanner.h b/src/platform/Tizen/ChipDeviceScanner.h index 09b5a6d5f39e15..c8ecc5bfa8e81a 100644 --- a/src/platform/Tizen/ChipDeviceScanner.h +++ b/src/platform/Tizen/ChipDeviceScanner.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include diff --git a/src/platform/Zephyr/BLEManagerImpl.cpp b/src/platform/Zephyr/BLEManagerImpl.cpp index d4e83332452a06..4eba52756d1368 100644 --- a/src/platform/Zephyr/BLEManagerImpl.cpp +++ b/src/platform/Zephyr/BLEManagerImpl.cpp @@ -27,7 +27,7 @@ #include -#include +#include #include #include #include diff --git a/src/platform/android/BLEManagerImpl.cpp b/src/platform/android/BLEManagerImpl.cpp index 05dfb5f560fbb5..d729ba5134573c 100644 --- a/src/platform/android/BLEManagerImpl.cpp +++ b/src/platform/android/BLEManagerImpl.cpp @@ -23,7 +23,7 @@ */ #include -#include +#include #include #include #include diff --git a/src/platform/android/BLEManagerImpl.h b/src/platform/android/BLEManagerImpl.h index effa75db4ce3b4..1b25d6b11b44c1 100644 --- a/src/platform/android/BLEManagerImpl.h +++ b/src/platform/android/BLEManagerImpl.h @@ -23,7 +23,7 @@ #pragma once -#include +#include #include #include #include diff --git a/src/platform/bouffalolab/common/BLEManagerImpl.cpp b/src/platform/bouffalolab/common/BLEManagerImpl.cpp index 1612f080d03575..b2f2c82f60716e 100644 --- a/src/platform/bouffalolab/common/BLEManagerImpl.cpp +++ b/src/platform/bouffalolab/common/BLEManagerImpl.cpp @@ -21,7 +21,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include +#include #include #include #include diff --git a/src/platform/bouffalolab/common/BLEManagerImpl.h b/src/platform/bouffalolab/common/BLEManagerImpl.h index a0c69fe242372b..b0682b80e11b19 100644 --- a/src/platform/bouffalolab/common/BLEManagerImpl.h +++ b/src/platform/bouffalolab/common/BLEManagerImpl.h @@ -20,7 +20,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include +#include #include #include diff --git a/src/platform/cc13xx_26xx/BLEManagerImpl.cpp b/src/platform/cc13xx_26xx/BLEManagerImpl.cpp index 4d0c009eef1f39..e733184a9314f0 100644 --- a/src/platform/cc13xx_26xx/BLEManagerImpl.cpp +++ b/src/platform/cc13xx_26xx/BLEManagerImpl.cpp @@ -29,7 +29,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include +#include #include #include "FreeRTOS.h" diff --git a/src/platform/cc13xx_26xx/chipOBleProfile.h b/src/platform/cc13xx_26xx/chipOBleProfile.h index d208733928bb52..e04b70eba80402 100644 --- a/src/platform/cc13xx_26xx/chipOBleProfile.h +++ b/src/platform/cc13xx_26xx/chipOBleProfile.h @@ -26,7 +26,7 @@ #define CHIPOBLEPROFILE_H #ifdef __cplusplus -#include +#include #include #include diff --git a/src/platform/mbed/BLEManagerImpl.cpp b/src/platform/mbed/BLEManagerImpl.cpp index aa797ff95f6f4c..75c749f3f145f5 100644 --- a/src/platform/mbed/BLEManagerImpl.cpp +++ b/src/platform/mbed/BLEManagerImpl.cpp @@ -30,7 +30,7 @@ #include -#include +#include #include #include #include diff --git a/src/platform/mbed/BLEManagerImpl.h b/src/platform/mbed/BLEManagerImpl.h index 6dfb1d56e2097b..91675e08ab13c4 100644 --- a/src/platform/mbed/BLEManagerImpl.h +++ b/src/platform/mbed/BLEManagerImpl.h @@ -27,7 +27,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include +#include namespace chip { namespace DeviceLayer { diff --git a/src/platform/mt793x/BLEManagerImpl.cpp b/src/platform/mt793x/BLEManagerImpl.cpp index f1ac9bfa707b88..0a90f2e2a733ba 100644 --- a/src/platform/mt793x/BLEManagerImpl.cpp +++ b/src/platform/mt793x/BLEManagerImpl.cpp @@ -34,7 +34,7 @@ #include "FreeRTOS.h" #include "event_groups.h" #include "timers.h" -#include +#include #include #include diff --git a/src/platform/nxp/common/ConnectivityManagerImpl.cpp b/src/platform/nxp/common/ConnectivityManagerImpl.cpp index 2753451c5308ff..c9d2861686b143 100644 --- a/src/platform/nxp/common/ConnectivityManagerImpl.cpp +++ b/src/platform/nxp/common/ConnectivityManagerImpl.cpp @@ -590,6 +590,34 @@ void ConnectivityManagerImpl::ConnectNetworkTimerHandler(::chip::System::Layer * PlatformMgr().UnlockChipStack(); } } + +/* Can be used to disconnect from WiFi network. + */ +CHIP_ERROR ConnectivityManagerImpl::_DisconnectNetwork(void) +{ + int ret = 0; + CHIP_ERROR err = CHIP_NO_ERROR; + + if (ConnectivityMgrImpl().IsWiFiStationConnected()) + { + ChipLogProgress(NetworkProvisioning, "Disconnecting from WiFi network."); + + ret = wlan_disconnect(); + + if (ret != WM_SUCCESS) + { + ChipLogError(NetworkProvisioning, "Failed to disconnect from network with error: %u", (uint8_t) ret); + err = CHIP_ERROR_UNEXPECTED_EVENT; + } + } + else + { + ChipLogError(NetworkProvisioning, "Error: WiFi not connected!"); + err = CHIP_ERROR_INCORRECT_STATE; + } + + return err; +} #endif } // namespace DeviceLayer diff --git a/src/platform/nxp/common/ConnectivityManagerImpl.h b/src/platform/nxp/common/ConnectivityManagerImpl.h index 806826daf0f7d3..49e4f66a13197b 100644 --- a/src/platform/nxp/common/ConnectivityManagerImpl.h +++ b/src/platform/nxp/common/ConnectivityManagerImpl.h @@ -115,6 +115,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, bool _IsWiFiStationEnabled(); bool _IsWiFiStationConnected(); bool _IsWiFiStationApplicationControlled(); + CHIP_ERROR _DisconnectNetwork(void); #endif /* CHIP_DEVICE_CONFIG_ENABLE_WPA */ // ===== Members for internal use by the following friends. diff --git a/src/platform/nxp/common/NetworkCommissioningDriver.h b/src/platform/nxp/common/NetworkCommissioningDriver.h index 5757771476e057..33d7d5bc1ed3af 100644 --- a/src/platform/nxp/common/NetworkCommissioningDriver.h +++ b/src/platform/nxp/common/NetworkCommissioningDriver.h @@ -72,10 +72,6 @@ class NXPWiFiDriver final : public WiFiDriver Status ReorderNetwork(ByteSpan networkId, uint8_t index, MutableCharSpan & outDebugText) override; void ConnectNetwork(ByteSpan networkId, ConnectCallback * callback) override; - /* Can be used to disconnect from WiFi network. - */ - int DisconnectNetwork(); - /* Returns the network SSID. User needs to allocate a buffer of size >= DeviceLayer::Internal::kMaxWiFiSSIDLength. * ssid - pointer to the returned SSID */ diff --git a/src/platform/nxp/common/NetworkCommissioningWiFiDriver.cpp b/src/platform/nxp/common/NetworkCommissioningWiFiDriver.cpp index d697c75d1042d7..c201dad7a6661c 100644 --- a/src/platform/nxp/common/NetworkCommissioningWiFiDriver.cpp +++ b/src/platform/nxp/common/NetworkCommissioningWiFiDriver.cpp @@ -142,14 +142,39 @@ Status NXPWiFiDriver::AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials, Mu Status NXPWiFiDriver::RemoveNetwork(ByteSpan networkId, MutableCharSpan & outDebugText, uint8_t & outNetworkIndex) { + int err_code = 0; + outDebugText.reduce_size(0); outNetworkIndex = 0; VerifyOrReturnError(NetworkMatch(mStagingNetwork, networkId), Status::kNetworkIDNotFound); - // Use empty ssid for representing invalid network - mStagingNetwork.ssidLen = 0; - memset(mStagingNetwork.ssid, 0, DeviceLayer::Internal::kMaxWiFiSSIDLength); - memset(mStagingNetwork.credentials, 0, DeviceLayer::Internal::kMaxWiFiKeyLength); + err_code = wlan_remove_network((char *) networkId.data()); + + switch (err_code) + { + case -WM_E_INVAL: + ChipLogError(DeviceLayer, "Error: Network not found"); + break; + + case WM_SUCCESS: + /* Use empty ssid for representing invalid network */ + mStagingNetwork.ssidLen = 0; + memset(mStagingNetwork.ssid, 0, DeviceLayer::Internal::kMaxWiFiSSIDLength); + memset(mStagingNetwork.credentials, 0, DeviceLayer::Internal::kMaxWiFiKeyLength); + /* Save to persistent memory */ + CommitConfiguration(); + ChipLogProgress(DeviceLayer, "Successfully removed network"); + break; + + case WLAN_ERROR_STATE: + ChipLogError(DeviceLayer, "Error: Can't remove network in this state"); + break; + + default: + ChipLogError(DeviceLayer, "Error: Unable to remove network"); + break; + } + return Status::kSuccess; } @@ -238,29 +263,6 @@ void NXPWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callbac } } -int NXPWiFiDriver::DisconnectNetwork(void) -{ - int ret = 0; - - if (ConnectivityMgrImpl().IsWiFiStationConnected()) - { - ChipLogProgress(NetworkProvisioning, "Disconnecting from WiFi network."); - - ret = wlan_disconnect(); - - if (ret != WM_SUCCESS) - { - ChipLogError(NetworkProvisioning, "Failed to disconnect from network with error: %u", (uint8_t) ret); - } - } - else - { - ChipLogError(NetworkProvisioning, "Error: WiFi not connected!"); - } - - return ret; -} - CHIP_ERROR NXPWiFiDriver::StartScanWiFiNetworks(ByteSpan ssid) { wlan_scan_params_v2_t wlan_scan_param; diff --git a/src/platform/nxp/k32w/common/BLEManagerCommon.cpp b/src/platform/nxp/k32w/common/BLEManagerCommon.cpp index b532ddef7f207e..12b32b8e4b71b2 100644 --- a/src/platform/nxp/k32w/common/BLEManagerCommon.cpp +++ b/src/platform/nxp/k32w/common/BLEManagerCommon.cpp @@ -32,7 +32,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include +#include #include "board.h" #include "gatt_db_app_interface.h" diff --git a/src/platform/qpg/BLEManagerImpl.cpp b/src/platform/qpg/BLEManagerImpl.cpp index 44fbf9367282d4..271c9b02e10d9f 100644 --- a/src/platform/qpg/BLEManagerImpl.cpp +++ b/src/platform/qpg/BLEManagerImpl.cpp @@ -25,8 +25,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include -#include +#include #include #include diff --git a/src/platform/silabs/efr32/BLEManagerImpl.cpp b/src/platform/silabs/efr32/BLEManagerImpl.cpp index 1f82f475c8bb4f..4a6d78574005c1 100644 --- a/src/platform/silabs/efr32/BLEManagerImpl.cpp +++ b/src/platform/silabs/efr32/BLEManagerImpl.cpp @@ -39,7 +39,7 @@ extern "C" { #include "sl_bt_stack_config.h" #include "sl_bt_stack_init.h" #include "timers.h" -#include +#include #include #include #include diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 4ce7ef6973b553..e7495322018170 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -51,7 +51,7 @@ extern "C" { } #endif -#include +#include #include #include #include diff --git a/src/platform/stm32/BLEManagerImpl.cpp b/src/platform/stm32/BLEManagerImpl.cpp index 60863a2da6a698..fc24ebc64ac006 100644 --- a/src/platform/stm32/BLEManagerImpl.cpp +++ b/src/platform/stm32/BLEManagerImpl.cpp @@ -24,8 +24,7 @@ /* this file behaves like a config.h, comes first */ #include -#include -#include +#include #include #include diff --git a/src/platform/stm32/BLEManagerImpl.h b/src/platform/stm32/BLEManagerImpl.h index 98812500eac0b0..36b6c39d4b74ec 100644 --- a/src/platform/stm32/BLEManagerImpl.h +++ b/src/platform/stm32/BLEManagerImpl.h @@ -25,7 +25,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include +#include #include #include "FreeRTOS.h" diff --git a/src/platform/telink/BLEManagerImpl.cpp b/src/platform/telink/BLEManagerImpl.cpp index 220501a84f673a..69252b66a0ecef 100644 --- a/src/platform/telink/BLEManagerImpl.cpp +++ b/src/platform/telink/BLEManagerImpl.cpp @@ -27,7 +27,7 @@ #include -#include +#include #include #include #include diff --git a/src/platform/webos/BLEManagerImpl.cpp b/src/platform/webos/BLEManagerImpl.cpp index 670c86e8233237..6d9726c9c94742 100644 --- a/src/platform/webos/BLEManagerImpl.cpp +++ b/src/platform/webos/BLEManagerImpl.cpp @@ -23,7 +23,7 @@ */ #include -#include +#include #include #include #include diff --git a/src/platform/webos/BLEManagerImpl.h b/src/platform/webos/BLEManagerImpl.h index cc3f7c3d84ae2a..7336f95c02409c 100644 --- a/src/platform/webos/BLEManagerImpl.h +++ b/src/platform/webos/BLEManagerImpl.h @@ -23,7 +23,7 @@ #pragma once -#include +#include #include #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/src/platform/webos/ChipDeviceScanner.h b/src/platform/webos/ChipDeviceScanner.h index ac23c7bd4b68aa..3bc50171ccf99c 100644 --- a/src/platform/webos/ChipDeviceScanner.h +++ b/src/platform/webos/ChipDeviceScanner.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include diff --git a/src/setup_payload/SetupPayload.cpp b/src/setup_payload/SetupPayload.cpp index 3b427f3b312473..3d312cd5846e8d 100644 --- a/src/setup_payload/SetupPayload.cpp +++ b/src/setup_payload/SetupPayload.cpp @@ -146,7 +146,7 @@ bool PayloadContents::CheckPayloadCommonConstraints() const return true; } -bool PayloadContents::operator==(PayloadContents & input) const +bool PayloadContents::operator==(const PayloadContents & input) const { return (this->version == input.version && this->vendorID == input.vendorID && this->productID == input.productID && this->commissioningFlow == input.commissioningFlow && this->rendezvousInformation == input.rendezvousInformation && @@ -257,10 +257,11 @@ CHIP_ERROR SetupPayload::addOptionalExtensionData(const OptionalQRCodeInfoExtens return CHIP_NO_ERROR; } -CHIP_ERROR SetupPayload::getOptionalVendorData(uint8_t tag, OptionalQRCodeInfo & info) +CHIP_ERROR SetupPayload::getOptionalVendorData(uint8_t tag, OptionalQRCodeInfo & info) const { - VerifyOrReturnError(optionalVendorData.find(tag) != optionalVendorData.end(), CHIP_ERROR_KEY_NOT_FOUND); - info = optionalVendorData[tag]; + const auto it = optionalVendorData.find(tag); + VerifyOrReturnError(it != optionalVendorData.end(), CHIP_ERROR_KEY_NOT_FOUND); + info = it->second; return CHIP_NO_ERROR; } @@ -273,7 +274,7 @@ CHIP_ERROR SetupPayload::getOptionalExtensionData(uint8_t tag, OptionalQRCodeInf return CHIP_NO_ERROR; } -optionalQRCodeInfoType SetupPayload::getNumericTypeFor(uint8_t tag) +optionalQRCodeInfoType SetupPayload::getNumericTypeFor(uint8_t tag) const { optionalQRCodeInfoType elemType = optionalQRCodeInfoTypeUnknown; @@ -289,7 +290,7 @@ optionalQRCodeInfoType SetupPayload::getNumericTypeFor(uint8_t tag) return elemType; } -std::vector SetupPayload::getAllOptionalExtensionData() +std::vector SetupPayload::getAllOptionalExtensionData() const { std::vector returnedOptionalInfo; for (auto & entry : optionalExtensionData) @@ -299,7 +300,7 @@ std::vector SetupPayload::getAllOptionalExtensionDa return returnedOptionalInfo; } -bool SetupPayload::operator==(SetupPayload & input) +bool SetupPayload::operator==(const SetupPayload & input) const { std::vector inputOptionalVendorData; std::vector inputOptionalExtensionData; diff --git a/src/setup_payload/SetupPayload.h b/src/setup_payload/SetupPayload.h index 0bb21698341279..9b18574480ba6e 100644 --- a/src/setup_payload/SetupPayload.h +++ b/src/setup_payload/SetupPayload.h @@ -130,7 +130,7 @@ struct PayloadContents bool isValidQRCodePayload() const; bool isValidManualCode() const; - bool operator==(PayloadContents & input) const; + bool operator==(const PayloadContents & input) const; static bool IsValidSetupPIN(uint32_t setupPIN); @@ -233,7 +233,7 @@ class SetupPayload : public PayloadContents **/ CHIP_ERROR removeSerialNumber(); - bool operator==(SetupPayload & input); + bool operator==(const SetupPayload & input) const; private: std::map optionalVendorData; @@ -267,14 +267,14 @@ class SetupPayload : public PayloadContents * @brief A function to retrieve the vector of CHIPQRCodeInfo infos * @return Returns a vector of CHIPQRCodeInfos **/ - std::vector getAllOptionalExtensionData(); + std::vector getAllOptionalExtensionData() const; /** @brief A function to retrieve an optional QR Code info vendor object * @param tag 7 bit [0-127] tag number * @param info retrieved OptionalQRCodeInfo object * @return Returns a CHIP_ERROR_KEY_NOT_FOUND on error, CHIP_NO_ERROR otherwise **/ - CHIP_ERROR getOptionalVendorData(uint8_t tag, OptionalQRCodeInfo & info); + CHIP_ERROR getOptionalVendorData(uint8_t tag, OptionalQRCodeInfo & info) const; /** @brief A function to retrieve an optional QR Code info extended object * @param tag 8 bit [128-255] tag number @@ -287,7 +287,7 @@ class SetupPayload : public PayloadContents * @param tag 8 bit [0-255] tag number * @return Returns an optionalQRCodeInfoType value **/ - optionalQRCodeInfoType getNumericTypeFor(uint8_t tag); + optionalQRCodeInfoType getNumericTypeFor(uint8_t tag) const; }; } // namespace chip diff --git a/src/system/SystemPacketBuffer.h b/src/system/SystemPacketBuffer.h index 88db4196438c1d..882a097d66cf38 100644 --- a/src/system/SystemPacketBuffer.h +++ b/src/system/SystemPacketBuffer.h @@ -687,7 +687,7 @@ class DLL_EXPORT PacketBufferHandle PacketBuffer * Get() const { return mBuffer; } - bool operator==(const PacketBufferHandle & aOther) { return mBuffer == aOther.mBuffer; } + bool operator==(const PacketBufferHandle & aOther) const { return mBuffer == aOther.mBuffer; } #if CHIP_SYSTEM_PACKETBUFFER_HAS_RIGHTSIZE void InternalRightSize(); diff --git a/src/transport/SecureSession.h b/src/transport/SecureSession.h index b18cc05b4ce716..c5e04628f17c3f 100644 --- a/src/transport/SecureSession.h +++ b/src/transport/SecureSession.h @@ -22,7 +22,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/src/transport/UnauthenticatedSessionTable.h b/src/transport/UnauthenticatedSessionTable.h index f5ba35df533de5..1c3ff7ed55586a 100644 --- a/src/transport/UnauthenticatedSessionTable.h +++ b/src/transport/UnauthenticatedSessionTable.h @@ -16,7 +16,7 @@ */ #pragma once -#include +#include #include #include #include diff --git a/src/transport/raw/BLE.h b/src/transport/raw/BLE.h index 548af414b2fffe..5e9da499664329 100644 --- a/src/transport/raw/BLE.h +++ b/src/transport/raw/BLE.h @@ -24,12 +24,9 @@ #pragma once -#include - #include -#include -#include +#include #include #include #include diff --git a/third_party/nxp/rt_sdk/rt_sdk.gni b/third_party/nxp/rt_sdk/rt_sdk.gni index 9063361f7b9d4d..eb44f01802ce14 100644 --- a/third_party/nxp/rt_sdk/rt_sdk.gni +++ b/third_party/nxp/rt_sdk/rt_sdk.gni @@ -562,11 +562,7 @@ template("rt_sdk") { } if (chip_enable_wifi) { - if (!w8801_transceiver) { - defines += [ "CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION=1" ] - } else { - defines += [ "CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION=0" ] - } + defines += [ "CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION=1" ] } # Now add our "system-header" include dirs