From 36f9ff6d757e51aa20c8f59817e94e645fb04a35 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Thu, 29 Feb 2024 18:05:02 +1300 Subject: [PATCH 01/19] Use host toolchain for all mac and ios targets (#32283) * Use host toolchain for all mac and ios targets. * Fix ASAN options for clang build * Collect .ips files from the system directory as well --- .github/workflows/darwin.yaml | 11 +++---- build/config/BUILDCONFIG.gn | 11 +++---- build/config/compiler/BUILD.gn | 4 +-- build/toolchain/ios/BUILD.gn | 42 ------------------------- examples/darwin-framework-tool/BUILD.gn | 1 + 5 files changed, 11 insertions(+), 58 deletions(-) delete mode 100644 build/toolchain/ios/BUILD.gn diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index a58617131a035d..0602b735d36b88 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -119,13 +119,10 @@ jobs: run: | xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos working-directory: examples/tv-casting-app/darwin/MatterTvCastingBridge - - name: Uploading .ips files in Xcode derived data to debug the failure - uses: actions/upload-artifact@v4 - if: ${{ failure() && !env.ACT }} - with: - name: darwin-framework-derived-data - path: ~/Library/Developer/Xcode/DerivedData/**/*.ips - retention-days: 5 + - name: Collect crash logs + run: | + mkdir -p /tmp/darwin/framework-tests + find ~/Library/Developer/Xcode/DerivedData /Library/Logs/DiagnosticReports -name '*.ips' -print0 | xargs -0 -J % cp % /tmp/darwin/framework-tests - name: Uploading log files uses: actions/upload-artifact@v4 if: ${{ failure() && !env.ACT }} diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index 01626726e0b9af..7eb09b79c4c22d 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -76,11 +76,11 @@ if (_chip_defaults.custom_toolchain != "") { } else { _target_compiler = "gcc" } - _default_toolchain = "${_build_overrides.build_root}/toolchain/linux:linux_${target_cpu}_${_target_compiler}" -} else if (target_os == host_os && - (target_cpu == host_cpu || - (target_cpu == "arm64e" && host_cpu == "arm64"))) { +} else if (host_os == "mac" && (target_os == "mac" || target_os == "ios")) { + # On Mac the host toolchain supports building for all mac and ios targets + _default_toolchain = host_toolchain +} else if (target_os == host_os && target_cpu == host_cpu) { _default_toolchain = host_toolchain } else if (target_os == "freertos") { if (_chip_defaults.is_clang) { @@ -113,9 +113,6 @@ if (_chip_defaults.custom_toolchain != "") { } else { assert(false, "Unsupported target_cpu: ${current_cpu}") } -} else if (target_os == "ios") { - _default_toolchain = - "${_build_overrides.build_root}/toolchain/ios:ios_${target_cpu}" } else if (target_os == "tizen") { _default_toolchain = "${_build_overrides.build_root}/toolchain/tizen:tizen_${target_cpu}" diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 7ada1348f797b4..df85153297cad7 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -343,7 +343,7 @@ config("cosmetic_default") { } config("runtime_default") { - if (is_clang) { + if (is_clang) { # Using Pigweed clang instead of Darwin host clang configs = [ "$dir_pw_toolchain/host_clang:no_system_libcpp", "$dir_pw_toolchain/host_clang:xcode_sysroot", @@ -402,7 +402,7 @@ config("sanitize_address") { ] ldflags = cflags - if (target_os == "mac" || target_os == "ios") { + if ((target_os == "mac" || target_os == "ios") && !is_clang) { defines += [ "_LIBCPP_HAS_NO_ASAN" ] } } diff --git a/build/toolchain/ios/BUILD.gn b/build/toolchain/ios/BUILD.gn deleted file mode 100644 index c86dfcb83b38d5..00000000000000 --- a/build/toolchain/ios/BUILD.gn +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2020 The Pigweed Authors -# Copyright (c) 2020 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. - -import("//build_overrides/build.gni") - -import("${build_root}/toolchain/gcc_toolchain.gni") - -gcc_toolchain("ios_arm") { - toolchain_args = { - current_os = "ios" - current_cpu = "arm" - is_clang = false - } -} - -gcc_toolchain("ios_arm64") { - toolchain_args = { - current_os = "ios" - current_cpu = "arm64" - is_clang = false - } -} - -gcc_toolchain("ios_x64") { - toolchain_args = { - current_os = "ios" - current_cpu = "x86_64" - is_clang = false - } -} diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn index 9dcbddbbfd8cbf..6228643a958f81 100644 --- a/examples/darwin-framework-tool/BUILD.gn +++ b/examples/darwin-framework-tool/BUILD.gn @@ -139,6 +139,7 @@ action("build-darwin-framework") { config("config") { include_dirs = [ ".", + "include", "${chip_root}/examples/common", "${chip_root}/examples/darwin-framework-tool/commands/common", "${chip_root}/zzz_generated/darwin-framework-tool", From 33119dc9e08ac0eb8305f4098631bc972addcbd8 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Wed, 28 Feb 2024 21:44:57 -0800 Subject: [PATCH 02/19] [Android] Fix write/invoke UI with text instead of number (#32364) --- .github/workflows/java-tests.yaml | 4 ++-- .../app/src/main/res/layout/wildcard_fragment.xml | 5 +++-- .../android/CHIPTool/app/src/main/res/values/strings.xml | 3 ++- .../pairing/PairOnNetworkLongImExtendableInvokeCommand.kt | 2 +- scripts/tests/java/im_test.py | 8 ++++---- .../chip/devicecontroller/model/NoInvokeResponseData.java | 5 +++++ 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/java-tests.yaml b/.github/workflows/java-tests.yaml index 3aa6935d1735c4..8d21ca0bd4c56d 100644 --- a/.github/workflows/java-tests.yaml +++ b/.github/workflows/java-tests.yaml @@ -133,7 +133,7 @@ jobs: --tool-args "onnetwork-long-im-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ --factoryreset \ ' - - name: Run IM Batch Invoke Test + - name: Run IM Extendable Invoke Test run: | scripts/run_in_python_env.sh out/venv \ './scripts/tests/run_java_test.py \ @@ -141,7 +141,7 @@ jobs: --app-args "--discriminator 3840 --interface-id -1" \ --tool-path out/linux-x64-java-matter-controller \ --tool-cluster "im" \ - --tool-args "onnetwork-long-im-batch-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ + --tool-args "onnetwork-long-im-extendable-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ --factoryreset \ ' - name: Run IM Read Test diff --git a/examples/android/CHIPTool/app/src/main/res/layout/wildcard_fragment.xml b/examples/android/CHIPTool/app/src/main/res/layout/wildcard_fragment.xml index 22ee5d4fb6a5e7..4387724ef847ef 100644 --- a/examples/android/CHIPTool/app/src/main/res/layout/wildcard_fragment.xml +++ b/examples/android/CHIPTool/app/src/main/res/layout/wildcard_fragment.xml @@ -181,7 +181,7 @@ android:layout_height="wrap_content" android:layout_margin="16dp" android:visibility="gone" - android:inputType="number" /> + android:inputType="text" /> + android:inputType="text" + android:hint="@string/wildcard_invoke_value_help_label"/> Write Value Data Version optional - Invoke Value + Invoke Value(Json) + Example: {"0:UINT":1} Please add it to the list using Add Button. Subscription established diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt index d80e71acb53d73..0b1a2ab7467f5c 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt @@ -38,7 +38,7 @@ class PairOnNetworkLongImExtendableInvokeCommand( ) : PairingCommand( controller, - "onnetwork-long-im-batch-invoke", + "onnetwork-long-im-extendable-invoke", credsIssue, PairingModeType.ON_NETWORK, PairingNetworkType.NONE, diff --git a/scripts/tests/java/im_test.py b/scripts/tests/java/im_test.py index 6ac393629fbee8..8b826205ce007f 100755 --- a/scripts/tests/java/im_test.py +++ b/scripts/tests/java/im_test.py @@ -72,7 +72,7 @@ def TestCmdOnnetworkLongImInvoke(self, nodeid, setuppin, discriminator, timeout) return java_process.wait() def TestCmdOnnetworkLongImExtendableInvoke(self, nodeid, setuppin, discriminator, timeout): - java_command = self.command + ['im', 'onnetwork-long-im-batch-invoke', nodeid, setuppin, discriminator, timeout] + java_command = self.command + ['im', 'onnetwork-long-im-extendable-invoke', nodeid, setuppin, discriminator, timeout] logging.info(f"Execute: {java_command}") java_process = subprocess.Popen( java_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -109,11 +109,11 @@ def RunTest(self): code = self.TestCmdOnnetworkLongImInvoke(self.nodeid, self.setup_pin_code, self.discriminator, self.timeout) if code != 0: raise Exception(f"Testing pairing onnetwork-long-im-invoke failed with error {code}") - elif self.command_name == 'onnetwork-long-im-batch-invoke': - logging.info("Testing pairing onnetwork-long-im-batch-invoke") + elif self.command_name == 'onnetwork-long-im-extendable-invoke': + logging.info("Testing pairing onnetwork-long-im-extendable-invoke") code = self.TestCmdOnnetworkLongImExtendableInvoke(self.nodeid, self.setup_pin_code, self.discriminator, self.timeout) if code != 0: - raise Exception(f"Testing pairing onnetwork-long-im-batch-invoke failed with error {code}") + raise Exception(f"Testing pairing onnetwork-long-im-extendable-invoke failed with error {code}") elif self.command_name == 'onnetwork-long-im-write': logging.info("Testing pairing onnetwork-long-im-write") code = self.TestCmdOnnetworkLongImWrite(self.nodeid, self.setup_pin_code, self.discriminator, self.timeout) diff --git a/src/controller/java/src/chip/devicecontroller/model/NoInvokeResponseData.java b/src/controller/java/src/chip/devicecontroller/model/NoInvokeResponseData.java index 03e930c62a978f..bf61d9d63a795c 100644 --- a/src/controller/java/src/chip/devicecontroller/model/NoInvokeResponseData.java +++ b/src/controller/java/src/chip/devicecontroller/model/NoInvokeResponseData.java @@ -17,6 +17,7 @@ */ package chip.devicecontroller.model; +import java.util.Locale; import java.util.logging.Logger; /** Class for tracking failed invoke response data. */ @@ -32,6 +33,10 @@ public Integer getCommandRef() { return commandRef; } + public String toString() { + return String.format(Locale.ENGLISH, "commandRef %s", commandRef.toString()); + } + public static NoInvokeResponseData newInstance(int commandRef) { return new NoInvokeResponseData(commandRef); } From b42798174d9fc5d192d6aca7b29ded69ed155481 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Thu, 29 Feb 2024 11:30:05 +0530 Subject: [PATCH 03/19] [ESP32] Provide core dump summary in response to crash diagnostic log requests (#32331) * [ESP32] Provide core dump summary in response to crash diagnostic log requests. * use esp_core_dump_image_check when core dump size is requested --- .../esp32/README.md | 15 ++-- .../esp32/main/CMakeLists.txt | 2 +- ...diagnostic-logs-provider-delegate-impl.cpp | 70 +++++++++---------- .../diagnostic-logs-provider-delegate-impl.h | 28 +++++--- .../esp32/partitions.csv | 2 +- 5 files changed, 56 insertions(+), 61 deletions(-) diff --git a/examples/temperature-measurement-app/esp32/README.md b/examples/temperature-measurement-app/esp32/README.md index 99347fc6ead9f4..71210102d932bd 100644 --- a/examples/temperature-measurement-app/esp32/README.md +++ b/examples/temperature-measurement-app/esp32/README.md @@ -34,7 +34,6 @@ contains three files: ``` main/diagnostic_logs -├── crash.log ├── end_user_support.log └── network_diag.log ``` @@ -53,8 +52,8 @@ chip-tool diagnosticlogs retrieve-logs-request 0 0 1 0 # Read network diagnostic using BDX protocol chip-tool interactive start > diagnosticlogs retrieve-logs-request 1 1 1 0 --TransferFileDesignator network-diag.log -# Retrieve crash over BDX -> diagnosticlogs retrieve-logs-request 1 1 1 0 --TransferFileDesignator crash.bin +# Retrieve crash summary over BDX +> diagnosticlogs retrieve-logs-request 2 1 1 0 --TransferFileDesignator crash-summary.bin ``` esp-idf supports storing and retrieving @@ -73,15 +72,9 @@ This example's partition table and sdkconfig.default are already modified - Retrieve the core dump using diagnostic logs cluster ``` - # Read crash logs over BDX + # Read crash summary over BDX chip-tool interactive start - > diagnosticlogs retrieve-logs-request 1 1 1 0 --TransferFileDesignator crash.bin - ``` - -- Decode the crash logs, using espcoredump.py - ``` - espcoredump.py --chip (CHIP) info_corefile --core /tmp/crash.bin \ - --core-format elf build/chip-temperature-measurement-app.elf + > diagnosticlogs retrieve-logs-request 2 1 1 0 --TransferFileDesignator crash-summary.bin ``` ## Optimization diff --git a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt index 062266652dc303..89fa5e9f755455 100644 --- a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt +++ b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt @@ -55,7 +55,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" ) -set(PRIV_REQUIRES_LIST chip QRCode bt nvs_flash bootloader_support espcoredump) +set(PRIV_REQUIRES_LIST chip QRCode bt nvs_flash espcoredump) if (CONFIG_ENABLE_PW_RPC) # Append additional directories for RPC build diff --git a/examples/temperature-measurement-app/esp32/main/diagnostic-logs-provider-delegate-impl.cpp b/examples/temperature-measurement-app/esp32/main/diagnostic-logs-provider-delegate-impl.cpp index 5034e3f928788f..55336ea76030dd 100644 --- a/examples/temperature-measurement-app/esp32/main/diagnostic-logs-provider-delegate-impl.cpp +++ b/examples/temperature-measurement-app/esp32/main/diagnostic-logs-provider-delegate-impl.cpp @@ -21,10 +21,6 @@ #if defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) #include -#include -// Its a bit hackish but we need this in order to pull in the sizeof(core_dump_header_t) -// we can even use the static 20 but, what if that gets chagned? -#include "../include_core_dump/esp_core_dump_types.h" #endif // defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) using namespace chip; @@ -95,34 +91,16 @@ size_t LogProvider::GetCrashSize() size_t outSize = 0; #if defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) - size_t unusedOutAddr; - esp_err_t esp_err = esp_core_dump_image_get(&unusedOutAddr, &outSize); - VerifyOrReturnValue(esp_err == ESP_OK, 0, ChipLogError(DeviceLayer, "Failed to get core dump image, esp_err:%d", esp_err)); + // Verify that the crash is present and sane + esp_err_t esp_err = esp_core_dump_image_check(); + VerifyOrReturnValue(esp_err == ESP_OK, 0, ChipLogError(DeviceLayer, "Core dump image check failed, esp_err:%d", esp_err)); + + outSize = sizeof(esp_core_dump_summary_t); #endif // defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) return outSize; } -CHIP_ERROR LogProvider::MapCrashPartition(CrashLogContext * context) -{ -#if defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) - size_t outAddr, outSize; - esp_err_t esp_err = esp_core_dump_image_get(&outAddr, &outSize); - VerifyOrReturnError(esp_err == ESP_OK, CHIP_ERROR(ChipError::Range::kPlatform, esp_err), - ChipLogError(DeviceLayer, "Failed to get core dump image, esp_err:%d", esp_err)); - - /* map the full core dump parition, including the checksum. */ - esp_err = spi_flash_mmap(outAddr, outSize, SPI_FLASH_MMAP_DATA, &context->mappedAddress, &context->mappedHandle); - VerifyOrReturnError(esp_err == ESP_OK, CHIP_ERROR(ChipError::Range::kPlatform, esp_err), - ChipLogError(DeviceLayer, "Failed to mmap the crash partition, esp_err:%d", esp_err)); - - context->crashSize = static_cast(outSize); - return CHIP_NO_ERROR; -#else - return CHIP_ERROR_NOT_FOUND; -#endif // defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) -} - CHIP_ERROR LogProvider::PrepareLogContextForIntent(LogContext * context, IntentEnum intent) { context->intent = intent; @@ -146,11 +124,24 @@ CHIP_ERROR LogProvider::PrepareLogContextForIntent(LogContext * context, IntentE sCrashLogContext.Reset(); context->Crash.logContext = &sCrashLogContext; - CHIP_ERROR err = MapCrashPartition(context->Crash.logContext); - VerifyOrReturnError(err == CHIP_NO_ERROR, err, context->Crash.logContext = nullptr); + size_t crashSize = GetCrashSize(); + VerifyOrReturnError(crashSize > 0, CHIP_ERROR_NOT_FOUND); + + esp_core_dump_summary_t * summary = + reinterpret_cast(Platform::MemoryCalloc(1, sizeof(esp_core_dump_summary_t))); + VerifyOrReturnError(summary != nullptr, CHIP_ERROR_NO_MEMORY); + + esp_err_t esp_err = esp_core_dump_get_summary(summary); + if (esp_err != ESP_OK) + { + ChipLogError(DeviceLayer, "Failed to get core dump image, esp_err:%d", esp_err); + Platform::MemoryFree(summary); + return CHIP_ERROR_NOT_FOUND; + } - context->Crash.logContext->readOffset = sizeof(core_dump_header_t); - context->Crash.logContext->isMapped = true; + context->Crash.logContext->crashSize = crashSize; + context->Crash.logContext->readOffset = 0; + context->Crash.logContext->summary = summary; #else return CHIP_ERROR_NOT_FOUND; #endif // defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) @@ -177,7 +168,7 @@ void LogProvider::CleanupLogContextForIntent(LogContext * context) case IntentEnum::kCrashLogs: { #if defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) CrashLogContext * logContext = context->Crash.logContext; - spi_flash_munmap(logContext->mappedHandle); + // Reset() frees the summary if allocated logContext->Reset(); #endif // defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) } @@ -227,12 +218,15 @@ CHIP_ERROR LogProvider::GetDataForIntent(LogContext * context, MutableByteSpan & case IntentEnum::kCrashLogs: { #if defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) CrashLogContext * logContext = context->Crash.logContext; - size_t dataSize = logContext->crashSize - logContext->readOffset; - auto count = std::min(dataSize, outBuffer.size()); + + VerifyOrReturnError(logContext->readOffset < logContext->crashSize, CHIP_ERROR_INCORRECT_STATE, outBuffer.reduce_size(0)); + + size_t dataSize = logContext->crashSize - logContext->readOffset; + auto count = std::min(dataSize, outBuffer.size()); VerifyOrReturnError(CanCastTo(count), CHIP_ERROR_INVALID_ARGUMENT, outBuffer.reduce_size(0)); - const uint8_t * readAddr = reinterpret_cast(logContext->mappedAddress) + logContext->readOffset; + const uint8_t * readAddr = reinterpret_cast(logContext->summary) + logContext->readOffset; memcpy(outBuffer.data(), readAddr, count); outBuffer.reduce_size(count); @@ -257,12 +251,14 @@ CHIP_ERROR LogProvider::StartLogCollection(IntentEnum intent, LogSessionHandle & { VerifyOrReturnValue(IsValidIntent(intent), CHIP_ERROR_INVALID_ARGUMENT); +#if defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) // In case of crash logs we can only mmap at max once, so check before doing anything if (intent == IntentEnum::kCrashLogs) { - VerifyOrReturnError(sCrashLogContext.isMapped == false, CHIP_ERROR_INCORRECT_STATE, - ChipLogError(DeviceLayer, "Crash partition already mapped")); + VerifyOrReturnError(sCrashLogContext.summary == nullptr, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(DeviceLayer, "Crash summary already allocated")); } +#endif // defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) LogContext * context = reinterpret_cast(Platform::MemoryCalloc(1, sizeof(LogContext))); VerifyOrReturnValue(context != nullptr, CHIP_ERROR_NO_MEMORY); diff --git a/examples/temperature-measurement-app/esp32/main/include/diagnostic-logs-provider-delegate-impl.h b/examples/temperature-measurement-app/esp32/main/include/diagnostic-logs-provider-delegate-impl.h index c3d1bd389fb39b..3431a54adc86a8 100644 --- a/examples/temperature-measurement-app/esp32/main/include/diagnostic-logs-provider-delegate-impl.h +++ b/examples/temperature-measurement-app/esp32/main/include/diagnostic-logs-provider-delegate-impl.h @@ -20,7 +20,10 @@ #include #include -#include + +#if defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) +#include +#endif // defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) namespace chip { namespace app { @@ -57,20 +60,23 @@ class LogProvider : public DiagnosticLogsProviderDelegate struct CrashLogContext { - spi_flash_mmap_handle_t mappedHandle = 0; - const void * mappedAddress = nullptr; - uint32_t crashSize = 0; - uint32_t readOffset = 0; - bool isMapped = 0; +#if defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) + uint32_t crashSize = 0; + uint32_t readOffset = 0; + esp_core_dump_summary_t * summary = nullptr; void Reset() { - this->mappedHandle = 0; - this->mappedAddress = nullptr; - this->crashSize = 0; - this->readOffset = 0; - this->isMapped = 0; + this->crashSize = 0; + this->readOffset = 0; + + if (this->summary) + { + Platform::MemoryFree(this->summary); + this->summary = nullptr; + } } +#endif // defined(CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH) && defined(CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF) }; static CrashLogContext sCrashLogContext; diff --git a/examples/temperature-measurement-app/esp32/partitions.csv b/examples/temperature-measurement-app/esp32/partitions.csv index 35c776d19e80fa..487ac3e70dd993 100644 --- a/examples/temperature-measurement-app/esp32/partitions.csv +++ b/examples/temperature-measurement-app/esp32/partitions.csv @@ -4,4 +4,4 @@ nvs, data, nvs, , 0xC000, phy_init, data, phy, , 0x1000, # Factory partition size about 1.5MB factory, app, factory, , 1536K, -coredump, data, coredump,, 64K +coredump, data, coredump,, 64K, encrypted From 04d7a3e3385ac57f40156e12464877df4fff53e8 Mon Sep 17 00:00:00 2001 From: beckerzito Date: Thu, 29 Feb 2024 10:36:37 -0300 Subject: [PATCH 04/19] Updated OnOff Test script according most recent test plan. (#32306) * updated on off test scripts according test plan * added missing CI Pics * updated cluster revision * Restyled by prettier-yaml * update label * Restyled by prettier-yaml * Added missing pics * fix yaml --------- Co-authored-by: Restyled.io --- .../all-clusters-app.matter | 4 +- .../all-clusters-common/all-clusters-app.zap | 6 +- src/app/tests/suites/certification/PICS.yaml | 3 + .../suites/certification/Test_TC_OO_1_1.yaml | 90 ++++++++++++++++--- .../suites/certification/Test_TC_OO_2_1.yaml | 52 ++++++++++- .../suites/certification/Test_TC_OO_2_2.yaml | 59 ++++++++---- .../tests/suites/certification/ci-pics-values | 1 + 7 files changed, 183 insertions(+), 32 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 5a7b510b05b0c8..89823f18e7896f 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -7761,7 +7761,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0x0001; - ram attribute clusterRevision default = 5; + ram attribute clusterRevision default = 6; handle command Off; handle command On; @@ -9134,7 +9134,7 @@ endpoint 2 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0x0001; - ram attribute clusterRevision default = 5; + ram attribute clusterRevision default = 6; handle command Off; handle command On; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 21bcfee37b5e0d..9dde80962f52f1 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -6659,7 +6659,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6895,7 +6895,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -23993,7 +23993,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 49554c37f4e3b6..d23a1db8cdc6cb 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -5294,6 +5294,9 @@ PICS: - label: "Device has Deadfront behaviour" id: OO.S.F01 + - label: "Device has OffOnly feature" + id: OO.S.F02 + # # server / manually # diff --git a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml index 400bf68a776788..5b44953041dac7 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml @@ -38,38 +38,75 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 5 + value: 6 constraints: type: int16u - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute." + - label: + "Step 3a: Given OO.S.F00(LT) ensure featuremap has the correct bit set" command: "readAttribute" attribute: "FeatureMap" - PICS: ( !OO.S.F00 && !OO.S.F01 ) + PICS: ( OO.S.F00 && !OO.S.F02 ) response: - value: 0 constraints: type: bitmap32 - + hasMasksSet: [0x1] - label: "Step 3b: Given OO.S.F00(LT) ensure featuremap has the correct bit set" command: "readAttribute" attribute: "FeatureMap" - PICS: OO.S.F00 + PICS: ( !( OO.S.F00 && !OO.S.F02 ) ) response: constraints: type: bitmap32 - hasMasksSet: [0x1] + hasMasksClear: [0x1] - label: "Step 3c: Given OO.S.F01(DF) ensure featuremap has the correct bit set" command: "readAttribute" attribute: "FeatureMap" - PICS: OO.S.F01 + PICS: ( OO.S.F01 && !OO.S.F02 ) response: constraints: type: bitmap32 hasMasksSet: [0x2] + - label: + "Step 3d: Given OO.S.F01(DF) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: ( !( OO.S.F01 && !OO.S.F02 ) ) + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Step 3e: Given OO.S.F02(OFFONLY) TH reads from the DUT the FeatureMap + attribute." + command: "readAttribute" + attribute: "FeatureMap" + PICS: ( OO.S.F02 && !OO.S.F00 && !OO.S.F01 ) + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4] + - label: + "Step 3f: Given OO.S.F02(OFFONLY) TH reads from the DUT the FeatureMap + attribute." + command: "readAttribute" + attribute: "FeatureMap" + PICS: ( !( OO.S.F02 && !OO.S.F00 && !OO.S.F01 ) ) + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + - label: "Step 3g: All remaining shall be zero" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksClear: [0xFFFFFFF8] - label: "Step 4a: TH reads from the DUT the AttributeList attribute." PICS: PICS_EVENT_LIST_ENABLED @@ -115,10 +152,32 @@ tests: response: constraints: type: list - contains: [0, 1, 2] + contains: [0] + + - label: + "Step 6b: TH reads the feature dependent(OO.S.F02) commands in + AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: ( !OO.S.F02 ) + response: + constraints: + type: list + contains: [1, 2] + + - label: + "Step 6c: TH reads the feature dependent(OO.S.F02) commands in + AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: OO.S.F02 + response: + constraints: + type: list + excludes: [1, 2] - label: - "Step 6b: TH reads the feature dependent(OO.S.F00) commands in + "Step 6d: TH reads the feature dependent(OO.S.F00) commands in AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -128,6 +187,17 @@ tests: type: list contains: [64, 65, 66] + - label: + "Step 6e: TH reads the feature dependent(OO.S.F00) commands in + AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: ( !OO.S.F00 ) + response: + constraints: + type: list + excludes: [64, 65, 66] + - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml index 89d84218aef428..bd6feca4901fc3 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml @@ -52,22 +52,70 @@ tests: command: "readAttribute" attribute: "OnTime" response: + saveAs: initialOnTime constraints: type: int16u minValue: 0 maxValue: 65535 - - label: "Step 5: TH reads the OffWaitTime attribute from the DUT" + - label: "Step 5: TH writes the OnTime attribute as 30" + PICS: OO.S.A4001 + command: "writeAttribute" + attribute: "OnTime" + arguments: + value: 30 + + - label: "Step 6: TH reads the OnTime attribute from the DUT" + PICS: OO.S.A4001 + command: "readAttribute" + attribute: "OnTime" + response: + value: 30 + + - label: + "Step 7: TH writes the OnTime attribute as 'initial-On-time' to + restore the original value" + PICS: OO.S.A4001 + command: "writeAttribute" + attribute: "OnTime" + arguments: + value: initialOnTime + + - label: "Step 8: TH reads the OffWaitTime attribute from the DUT" PICS: OO.S.A4002 command: "readAttribute" attribute: "OffWaitTime" response: + saveAs: initialOffWaitTime constraints: type: int16u minValue: 0 maxValue: 65535 - - label: "Step 6: TH reads the StartUpOnOff attribute from the DUT" + - label: "Step 9: TH writes the OffWaitTime attribute as 30" + PICS: OO.S.A4002 + command: "writeAttribute" + attribute: "OffWaitTime" + arguments: + value: 30 + + - label: "Step 10: TH reads the OffWaitTime attribute from the DUT" + PICS: OO.S.A4002 + command: "readAttribute" + attribute: "OffWaitTime" + response: + value: 30 + + - label: + "Step 11: TH writes the OffWaitTime attribute as + 'initial-Off-waittime' to restore the original value" + PICS: OO.S.A4002 + command: "writeAttribute" + attribute: "OffWaitTime" + arguments: + value: initialOffWaitTime + + - label: "Step 12: TH reads the StartUpOnOff attribute from the DUT" PICS: OO.S.A4003 command: "readAttribute" attribute: "StartUpOnOff" diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml index c477d542e8a7d9..e03bed6691bbd4 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml @@ -35,6 +35,14 @@ tests: PICS: OO.S.C00.Rsp command: "Off" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 2b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -46,6 +54,14 @@ tests: PICS: OO.S.C01.Rsp command: "On" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 3b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -57,6 +73,14 @@ tests: PICS: OO.S.C01.Rsp command: "On" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 3d: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -68,6 +92,14 @@ tests: PICS: OO.S.C00.Rsp command: "Off" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 4b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -79,6 +111,14 @@ tests: PICS: OO.S.C00.Rsp command: "Off" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 4d: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -86,7 +126,7 @@ tests: response: value: 0 - - label: "Step 5c: TH sends Toggle command to DUT" + - label: "Step 5a: TH sends Toggle command to DUT" PICS: OO.S.C02.Rsp command: "Toggle" @@ -98,14 +138,14 @@ tests: - name: "ms" value: 1000 - - label: "Step 5d: after a few seconds, TH reads OnOff attribute from DUT" + - label: "Step 5b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" attribute: "OnOff" response: value: 1 - - label: "TH sends Toggle command to DUT" + - label: "Step 5c: TH sends Toggle command to DUT" PICS: OO.S.C02.Rsp command: "Toggle" @@ -117,7 +157,7 @@ tests: - name: "ms" value: 1000 - - label: "Check on/off attribute value is false after toggle command" + - label: "Step 5d: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" attribute: "OnOff" @@ -161,14 +201,3 @@ tests: attribute: "OnOff" response: value: 0 - - - label: "Reset Off Command" - PICS: OO.S.C00.Rsp - command: "Off" - - - label: "Check on/off attribute value is false after off command" - PICS: OO.S.A0000 - command: "readAttribute" - attribute: "OnOff" - response: - value: 0 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 021f52e6547ec8..20f0a334979c40 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1211,6 +1211,7 @@ OO.S.C41.Rsp=1 OO.S.C42.Rsp=1 OO.S.F00=1 OO.S.F01=0 +OO.S.F02=0 OO.S.A4003=1 OO.M.ManuallyControlled=1 From e0b8a84fb99606332ca5d30fe881a93ee47dfc77 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Thu, 29 Feb 2024 12:04:55 -0500 Subject: [PATCH 05/19] Checking mFinishedCommandCount doesn't require mpPendingResponseTracker (#32375) --- src/app/CommandSender.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/app/CommandSender.cpp b/src/app/CommandSender.cpp index 268fd338ed89cd..af317f76003900 100644 --- a/src/app/CommandSender.cpp +++ b/src/app/CommandSender.cpp @@ -497,10 +497,7 @@ CHIP_ERROR CommandSender::PrepareCommand(const CommandPathParams & aCommandPathP bool canAddAnotherCommand = (mState == State::AddedCommand && mBatchCommandsEnabled && mUseExtendableCallback); VerifyOrReturnError(mState == State::Idle || canAddAnotherCommand, CHIP_ERROR_INCORRECT_STATE); - if (mpPendingResponseTracker != nullptr) - { - VerifyOrReturnError(mFinishedCommandCount < mRemoteMaxPathsPerInvoke, CHIP_ERROR_MAXIMUM_PATHS_PER_INVOKE_EXCEEDED); - } + VerifyOrReturnError(mFinishedCommandCount < mRemoteMaxPathsPerInvoke, CHIP_ERROR_MAXIMUM_PATHS_PER_INVOKE_EXCEEDED); if (mBatchCommandsEnabled) { From bdde9cf06ab251ec4a63524602728813d45096ef Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 29 Feb 2024 13:02:34 -0500 Subject: [PATCH 06/19] Define explicit `data_model` sub-targets for generated files (#32343) * Define some source sets for data_model * Update dependencies, this seems to work for non-gen for now (with odd naming) * Rename the generate commands and hopefully this makes pregen work * Start using privilege-constants * Add missing file * Fix lint error * Fix android build ... a bit ugly as this dynamic server business is too coupled * Restyle * fix dependency --------- Co-authored-by: Andrei Litvin --- build/chip/chip_codegen.gni | 8 +- .../all-clusters-app/app-templates/access.h | 2 +- .../lighting-app/app-templates/access.h | 2 +- src/app/BUILD.gn | 1 + src/app/chip_data_model.gni | 93 +++++++++++++++++++ src/app/util/privilege-constants.h | 23 +++++ src/app/util/privilege-storage.h | 7 +- .../zap-templates/templates/app/access.zapt | 2 +- 8 files changed, 125 insertions(+), 13 deletions(-) create mode 100644 src/app/util/privilege-constants.h diff --git a/build/chip/chip_codegen.gni b/build/chip/chip_codegen.gni index 08d9f17da6c1be..07f24bdc3e6bc0 100644 --- a/build/chip/chip_codegen.gni +++ b/build/chip/chip_codegen.gni @@ -35,7 +35,7 @@ template("_chip_build_time_codegen") { include_dirs = [ target_gen_dir ] } - pw_python_action("${_name}_codegen") { + pw_python_action("${_name}_generate") { script = "${chip_root}/scripts/codegen.py" # TODO: this seems to touch internals. Is this ok? speeds up builds! @@ -99,7 +99,7 @@ template("_chip_build_time_codegen") { if (!defined(deps)) { deps = [] } - deps += [ ":${_name}_codegen" ] + deps += [ ":${_name}_generate" ] } } @@ -152,7 +152,7 @@ template("_chip_build_time_zapgen") { _output_subdir = "zap-generated" } - pw_python_action("${_name}_zap") { + pw_python_action("${_name}_generate") { script = "${chip_root}/scripts/tools/zap/generate.py" # TODO: this seems to touch internals. Is this ok? speeds up builds! @@ -211,7 +211,7 @@ template("_chip_build_time_zapgen") { if (!defined(public_deps)) { public_deps = [] } - public_deps += [ ":${_name}_zap" ] + public_deps += [ ":${_name}_generate" ] } } diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h index 82dab06aeeae0f..f2260156616eed 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/access.h @@ -20,7 +20,7 @@ // Prevent multiple inclusion #pragma once -#include +#include // Prevent changing generated format // clang-format off diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h index 119c12e6f05c06..d2b8c67daa3fa7 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/access.h @@ -20,7 +20,7 @@ // Prevent multiple inclusion #pragma once -#include +#include // Prevent changing generated format // clang-format off diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index e6754bd8c32a31..618e51df303f3c 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -229,6 +229,7 @@ static_library("interaction-model") { "dynamic_server/AccessControl.cpp", "dynamic_server/AccessControl.h", "dynamic_server/DynamicDispatcher.cpp", + "util/privilege-constants.h", "util/privilege-storage.cpp", "util/privilege-storage.h", ] diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index a065d833b43846..29c5f0399737cc 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -32,6 +32,26 @@ _app_root = get_path_info(".", "abspath") # # Forwards all the remaining variables to the source_set. # +# +# +# Additional underlying source sets that will be provided +# +# - ${name}-endpoint-metadata +# contains HEADERS that define endpoint metadata from zap/matter files: +# - zap-generated/gen_config.h +# - zap-generated/endpoint_config.h +# - zap-generated/access.h +# - PluginApplicationCallbacks.h +# - ${name}-callbacks +# contains the callback implementation for cluster init: +# - cluster-init-callback.cpp +# - callback-stub.cpp (contains __weak__ implementations. TODO: we should not be using +# weak linkage over time at all) +# - ${name}-command-dispatch: +# contains the implementation of `DispatchServerCommand` which forwards data to +# `emberAf....Cluster...Callback` callbacks +# - zap-generated/IMClusterCommandHandler.cpp +# template("chip_data_model") { _data_model_name = target_name @@ -87,6 +107,79 @@ template("chip_data_model") { ] } + # where generated files reside + # TODO: where can this reside? + if (chip_code_pre_generated_directory == "") { + _zapgen_gen_dir = "${target_gen_dir}/zapgen" + _codegen_gen_dir = "${target_gen_dir}" + } else { + # NOTE: if zap and matter file will reside in different locations + # this path will change between zapgen and codegen + _pregen_dir = + chip_code_pre_generated_directory + "/" + + string_replace(rebase_path(invoker.zap_file, chip_root), ".zap", "") + + _zapgen_gen_dir = "${_pregen_dir}/zap/app-templates" + _codegen_gen_dir = "${_pregen_dir}/codegen/cpp-app" + } + + # Fixed source sets for allowing reasonable dependencies on things: + source_set("${_data_model_name}-endpoint-metadata") { + sources = [ + "${_codegen_gen_dir}/app/PluginApplicationCallbacks.h", + "${_zapgen_gen_dir}/zap-generated/access.h", + "${_zapgen_gen_dir}/zap-generated/endpoint_config.h", + "${_zapgen_gen_dir}/zap-generated/gen_config.h", + ] + + deps = [ "${chip_root}/src/lib/core:chip_config_header" ] + + if (chip_code_pre_generated_directory == "") { + deps += [ + ":${_data_model_name}_codegen_generate", + ":${_data_model_name}_zapgen_generate", + ] + } + } + + source_set("${_data_model_name}-callbacks") { + sources = [ + "${_codegen_gen_dir}/app/callback-stub.cpp", + "${_codegen_gen_dir}/app/cluster-init-callback.cpp", + ] + + deps = [ + "${chip_root}/src/app/common:ids", + "${chip_root}/src/lib/support:span", + "${chip_root}/src/protocols/interaction_model", + ] + + if (chip_code_pre_generated_directory == "") { + deps += [ ":${_data_model_name}_codegen_generate" ] + } + } + + if (!chip_build_controller_dynamic_server) { + source_set("${_data_model_name}-command-dispatch") { + sources = + [ "${_zapgen_gen_dir}/zap-generated/IMClusterCommandHandler.cpp" ] + + deps = [ + "${chip_root}/src/app", + "${chip_root}/src/app:interaction-model", + "${chip_root}/src/app/common:cluster-objects", + "${chip_root}/src/app/common:enums", + "${chip_root}/src/app/common:ids", + "${chip_root}/src/lib/core", + "${chip_root}/src/lib/support", + ] + + if (chip_code_pre_generated_directory == "") { + deps += [ ":${_data_model_name}_zapgen_generate" ] + } + } + } + source_set(_data_model_name) { forward_variables_from(invoker, "*", diff --git a/src/app/util/privilege-constants.h b/src/app/util/privilege-constants.h new file mode 100644 index 00000000000000..a9f56b509ca4cc --- /dev/null +++ b/src/app/util/privilege-constants.h @@ -0,0 +1,23 @@ +/** + * + * 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. + */ +#pragma once + +inline constexpr int kMatterAccessPrivilegeView = 0; +inline constexpr int kMatterAccessPrivilegeOperate = 1; +inline constexpr int kMatterAccessPrivilegeManage = 2; +inline constexpr int kMatterAccessPrivilegeAdminister = 3; +inline constexpr int kMatterAccessPrivilegeMaxValue = kMatterAccessPrivilegeAdminister; diff --git a/src/app/util/privilege-storage.h b/src/app/util/privilege-storage.h index 02d55488fd0780..6222d891b9c92a 100644 --- a/src/app/util/privilege-storage.h +++ b/src/app/util/privilege-storage.h @@ -16,14 +16,9 @@ */ #pragma once +#include #include -inline constexpr int kMatterAccessPrivilegeView = 0; -inline constexpr int kMatterAccessPrivilegeOperate = 1; -inline constexpr int kMatterAccessPrivilegeManage = 2; -inline constexpr int kMatterAccessPrivilegeAdminister = 3; -inline constexpr int kMatterAccessPrivilegeMaxValue = kMatterAccessPrivilegeAdminister; - int MatterGetAccessPrivilegeForReadAttribute(chip::ClusterId cluster, chip::AttributeId attribute); int MatterGetAccessPrivilegeForWriteAttribute(chip::ClusterId cluster, chip::AttributeId attribute); int MatterGetAccessPrivilegeForInvokeCommand(chip::ClusterId cluster, chip::CommandId command); diff --git a/src/app/zap-templates/templates/app/access.zapt b/src/app/zap-templates/templates/app/access.zapt index 483de62bce4c60..96ad5f54ae5075 100644 --- a/src/app/zap-templates/templates/app/access.zapt +++ b/src/app/zap-templates/templates/app/access.zapt @@ -3,7 +3,7 @@ // Prevent multiple inclusion #pragma once -#include +#include // Prevent changing generated format // clang-format off From 4c6bdbe091d7f73e24100e712e7fe79194077065 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Thu, 29 Feb 2024 14:13:27 -0500 Subject: [PATCH 07/19] Add needed function (#32344) --- src/platform/silabs/efr32/ThreadStackManagerImpl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/platform/silabs/efr32/ThreadStackManagerImpl.cpp b/src/platform/silabs/efr32/ThreadStackManagerImpl.cpp index 83767f9a0e1fb8..2cab401837e8d8 100644 --- a/src/platform/silabs/efr32/ThreadStackManagerImpl.cpp +++ b/src/platform/silabs/efr32/ThreadStackManagerImpl.cpp @@ -35,6 +35,9 @@ #include +// Forward declaration +extern "C" otInstance * otGetInstance(void); + namespace chip { namespace DeviceLayer { @@ -132,6 +135,11 @@ extern "C" otError otPlatUartEnable(void) #endif } +extern "C" otInstance * otGetInstance(void) +{ + return ThreadStackMgrImpl().OTInstance(); +} + #if CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI extern "C" otError otPlatUartSend(const uint8_t * aBuf, uint16_t aBufLength) From a94a3c5065cd64211b626e3ffbef533d41f8b71b Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Thu, 29 Feb 2024 14:13:47 -0500 Subject: [PATCH 08/19] Update UI (#32345) --- .../platform/silabs/display/demo-ui-bitmaps.h | 4 +++ examples/platform/silabs/display/demo-ui.c | 34 +++++++++---------- examples/platform/silabs/display/demo-ui.h | 2 +- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/examples/platform/silabs/display/demo-ui-bitmaps.h b/examples/platform/silabs/display/demo-ui-bitmaps.h index b5a6103a8fddb2..2a46413adad5b9 100644 --- a/examples/platform/silabs/display/demo-ui-bitmaps.h +++ b/examples/platform/silabs/display/demo-ui-bitmaps.h @@ -29,6 +29,10 @@ #define ZIGBEE_BITMAP_WIDTH 16 #define ZIGBEE_BITMAP_HEIGHT 16 +#define ZIGBEE_BITMAP \ + 0x3f, 0xfc, 0x07, 0xf0, 0xff, 0xc7, 0xff, 0x9f, 0x01, 0x9c, 0x00, 0x0e, 0x00, 0x07, 0x80, 0x03, 0xc0, 0x01, 0xe0, 0x00, 0x70, \ + 0x80, 0x39, 0x80, 0xf9, 0xff, 0xfb, 0xff, 0x07, 0xe0, 0x1f, 0xfc + #define RAIL_BITMAP_WIDTH 16 #define RAIL_BITMAP_HEIGHT 16 diff --git a/examples/platform/silabs/display/demo-ui.c b/examples/platform/silabs/display/demo-ui.c index a525ca9c231195..bccde3e3eaa449 100644 --- a/examples/platform/silabs/display/demo-ui.c +++ b/examples/platform/silabs/display/demo-ui.c @@ -23,6 +23,7 @@ #include "dmd/dmd.h" #include "em_types.h" #include "glib.h" +#include "sl_component_catalog.h" #include "sl_memlcd.h" #if SL_WIFI && !SIWX_917 #include "spi_multiplex.h" @@ -41,12 +42,8 @@ #define PROT2_ID_X_POSITION 79 // Matter Logo -#define PROT2_BITMAP_WIDTH MATTER_LOGO_WIDTH -#define PROT2_BITMAP_HEIGHT MATTER_LOGO_HEIGHT #define PROT2_X_POSITION 104 #define PROT2_Y_POSITION (APP_Y_POSITION + (APP_Y_POSITION / 2)) -#define PROT2_BITMAP (matterLogoBitmap) -#define PROT2_BITMAP_CONN (matterLogoBitmap) // Networking Protocol Logo #ifdef SL_WIFI @@ -54,15 +51,16 @@ #define PROT1_BITMAP_HEIGHT WIFI_BITMAP_HEIGHT #define PROT1_X_POSITION 8 #define PROT1_Y_POSITION (APP_Y_POSITION + (APP_Y_POSITION / 2)) -#define PROT1_BITMAP (networkBitMap) -#define PROT1_BITMAP_CONN (networkBitMap) #else #define PROT1_BITMAP_WIDTH THREAD_BITMAP_WIDTH #define PROT1_BITMAP_HEIGHT THREAD_BITMAP_HEIGHT #define PROT1_X_POSITION 8 +#ifdef SL_CATALOG_ZIGBEE_ZCL_FRAMEWORK_CORE_PRESENT +#define ZIGBEE_POSITION_Y (APP_Y_POSITION + (APP_Y_POSITION / 2) + (ZIGBEE_BITMAP_HEIGHT / 2)) +#define PROT1_Y_POSITION (APP_Y_POSITION + (APP_Y_POSITION / 2) - (ZIGBEE_BITMAP_HEIGHT / 2)) +#else #define PROT1_Y_POSITION (APP_Y_POSITION + (APP_Y_POSITION / 2)) -#define PROT1_BITMAP (networkBitMap) -#define PROT1_BITMAP_CONN (networkBitMap) +#endif #endif /******************************************************************************* @@ -82,6 +80,10 @@ static const uint8_t networkBitMap[] = { WIFI_BITMAP }; static const uint8_t networkBitMap[] = { THREAD_BITMAP }; #endif +#ifdef SL_CATALOG_ZIGBEE_ZCL_FRAMEWORK_CORE_PRESENT +static const uint8_t zigbeeBitMap[] = { ZIGBEE_BITMAP }; +#endif + // Future usage // static const uint8_t unconnectedBitMap[] = { QUESTION_MARK_BITMAP }; @@ -141,14 +143,13 @@ void demoUIDisplayApp(bool on) updateDisplay(); } -void demoUIDisplayProtocol(demoUIProtocol protocol, bool isConnected) +void demoUIDisplayProtocols() { - GLIB_drawBitmap(&glibContext, (protocol == DEMO_UI_PROTOCOL1 ? PROT1_X_POSITION : PROT2_X_POSITION), - (protocol == DEMO_UI_PROTOCOL1 ? PROT1_Y_POSITION : PROT2_Y_POSITION), - (protocol == DEMO_UI_PROTOCOL1 ? PROT1_BITMAP_WIDTH : PROT2_BITMAP_WIDTH), - (protocol == DEMO_UI_PROTOCOL1 ? PROT1_BITMAP_HEIGHT : PROT2_BITMAP_HEIGHT), - (protocol == DEMO_UI_PROTOCOL1 ? (isConnected ? PROT1_BITMAP_CONN : PROT1_BITMAP) - : (isConnected ? PROT2_BITMAP_CONN : PROT2_BITMAP))); + GLIB_drawBitmap(&glibContext, PROT2_X_POSITION, PROT2_Y_POSITION, MATTER_LOGO_WIDTH, MATTER_LOGO_HEIGHT, matterLogoBitmap); + GLIB_drawBitmap(&glibContext, PROT1_X_POSITION, PROT1_Y_POSITION, PROT1_BITMAP_WIDTH, PROT1_BITMAP_HEIGHT, networkBitMap); +#ifdef SL_CATALOG_ZIGBEE_ZCL_FRAMEWORK_CORE_PRESENT + GLIB_drawBitmap(&glibContext, PROT1_X_POSITION, ZIGBEE_POSITION_Y, ZIGBEE_BITMAP_WIDTH, ZIGBEE_BITMAP_HEIGHT, zigbeeBitMap); +#endif updateDisplay(); } @@ -157,6 +158,5 @@ void demoUIClearMainScreen(uint8_t * name) GLIB_clear(&glibContext); demoUIDisplayHeader((char *) name); demoUIDisplayApp(false); - demoUIDisplayProtocol(DEMO_UI_PROTOCOL1, false); - demoUIDisplayProtocol(DEMO_UI_PROTOCOL2, false); + demoUIDisplayProtocols(); } diff --git a/examples/platform/silabs/display/demo-ui.h b/examples/platform/silabs/display/demo-ui.h index baf4902ef6184b..aac7d4aa4640c9 100644 --- a/examples/platform/silabs/display/demo-ui.h +++ b/examples/platform/silabs/display/demo-ui.h @@ -126,7 +126,7 @@ void demoUIDisplayApp(bool on); * @return * void *****************************************************************************/ -void demoUIDisplayProtocol(demoUIProtocol protocol, bool isConnected); +void demoUIDisplayProtocols(); /**************************************************************************/ /** From 2e8b3aecbbe136e680ea3b5b4f1611ba646d9d58 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Thu, 29 Feb 2024 15:33:46 -0500 Subject: [PATCH 09/19] Have PairingSession::EncodeSessionParameters require local MRP values (#32324) * Have PairingSession::EncodeSessionParameters require local MRP values --- src/protocols/secure_channel/CASESession.cpp | 4 ++-- src/protocols/secure_channel/PASESession.cpp | 4 ++-- src/protocols/secure_channel/PairingSession.cpp | 10 +--------- src/protocols/secure_channel/PairingSession.h | 4 ++-- .../secure_channel/tests/TestPairingSession.cpp | 3 +-- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index ee8feaefb5f93d..30d1f71cb0ff64 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -477,7 +477,7 @@ CASESession::PrepareForSessionEstablishment(SessionManager & sessionManager, Fab mFabricsTable = fabricTable; mRole = CryptoContext::SessionRole::kResponder; mSessionResumptionStorage = sessionResumptionStorage; - mLocalMRPConfig = mrpLocalConfig; + mLocalMRPConfig = mrpLocalConfig.ValueOr(GetDefaultMRPConfig()); ChipLogDetail(SecureChannel, "Allocated SecureSession (%p) - waiting for Sigma1 msg", mSecureSessionHolder.Get().Value()->AsSecureSession()); @@ -525,7 +525,7 @@ CHIP_ERROR CASESession::EstablishSession(SessionManager & sessionManager, Fabric mFabricsTable = fabricTable; mFabricIndex = fabricInfo->GetFabricIndex(); mSessionResumptionStorage = sessionResumptionStorage; - mLocalMRPConfig = mrpLocalConfig; + mLocalMRPConfig = mrpLocalConfig.ValueOr(GetDefaultMRPConfig()); mExchangeCtxt->UseSuggestedResponseTimeout(kExpectedSigma1ProcessingTime); mPeerNodeId = peerScopedNodeId.GetNodeId(); diff --git a/src/protocols/secure_channel/PASESession.cpp b/src/protocols/secure_channel/PASESession.cpp index ab3007b26258a9..50b186100841e0 100644 --- a/src/protocols/secure_channel/PASESession.cpp +++ b/src/protocols/secure_channel/PASESession.cpp @@ -195,7 +195,7 @@ CHIP_ERROR PASESession::WaitForPairing(SessionManager & sessionManager, const Sp mIterationCount = pbkdf2IterCount; mNextExpectedMsg.SetValue(MsgType::PBKDFParamRequest); mPairingComplete = false; - mLocalMRPConfig = mrpLocalConfig; + mLocalMRPConfig = mrpLocalConfig.ValueOr(GetDefaultMRPConfig()); ChipLogDetail(SecureChannel, "Waiting for PBKDF param request"); @@ -225,7 +225,7 @@ CHIP_ERROR PASESession::Pair(SessionManager & sessionManager, uint32_t peerSetUp mExchangeCtxt->UseSuggestedResponseTimeout(kExpectedLowProcessingTime); - mLocalMRPConfig = mrpLocalConfig; + mLocalMRPConfig = mrpLocalConfig.ValueOr(GetDefaultMRPConfig()); err = SendPBKDFParamRequest(); SuccessOrExit(err); diff --git a/src/protocols/secure_channel/PairingSession.cpp b/src/protocols/secure_channel/PairingSession.cpp index 80e048597578be..6a6d03f43ebc65 100644 --- a/src/protocols/secure_channel/PairingSession.cpp +++ b/src/protocols/secure_channel/PairingSession.cpp @@ -90,17 +90,9 @@ void PairingSession::DiscardExchange() } } -CHIP_ERROR PairingSession::EncodeSessionParameters(TLV::Tag tag, const Optional & providedMrpConfig, +CHIP_ERROR PairingSession::EncodeSessionParameters(TLV::Tag tag, const ReliableMessageProtocolConfig & mrpLocalConfig, TLV::TLVWriter & tlvWriter) { - // TODO: https://github.com/project-chip/connectedhomeip/issues/30456. Based on the spec we need to send values here now, - // but it is not entirely clear what we should be sending here when `providedMrpConfig.HasValue() == false`. For now we - // are sending the default MRP config values. - ReliableMessageProtocolConfig mrpLocalConfig = GetDefaultMRPConfig(); - if (providedMrpConfig.HasValue()) - { - mrpLocalConfig = providedMrpConfig.Value(); - } TLV::TLVType mrpParamsContainer; ReturnErrorOnFailure(tlvWriter.StartContainer(tag, TLV::kTLVType_Structure, mrpParamsContainer)); ReturnErrorOnFailure( diff --git a/src/protocols/secure_channel/PairingSession.h b/src/protocols/secure_channel/PairingSession.h index e8849822de57e1..8ed9f269b9a32c 100644 --- a/src/protocols/secure_channel/PairingSession.h +++ b/src/protocols/secure_channel/PairingSession.h @@ -104,7 +104,7 @@ class DLL_EXPORT PairingSession : public SessionDelegate /** * Encode the Session Parameters using the provided TLV tag. */ - static CHIP_ERROR EncodeSessionParameters(TLV::Tag tag, const Optional & mrpLocalConfig, + static CHIP_ERROR EncodeSessionParameters(TLV::Tag tag, const ReliableMessageProtocolConfig & mrpLocalConfig, TLV::TLVWriter & tlvWriter); protected: @@ -238,7 +238,7 @@ class DLL_EXPORT PairingSession : public SessionDelegate // mLocalMRPConfig is our config which is sent to the other end and used by the peer session. // mRemoteSessionParams is received from other end and set to our session. - Optional mLocalMRPConfig; + ReliableMessageProtocolConfig mLocalMRPConfig = GetLocalMRPConfig().ValueOr(GetDefaultMRPConfig()); SessionParameters mRemoteSessionParams; private: diff --git a/src/protocols/secure_channel/tests/TestPairingSession.cpp b/src/protocols/secure_channel/tests/TestPairingSession.cpp index ac1c4537888bc8..e0e4a7cd9601c8 100644 --- a/src/protocols/secure_channel/tests/TestPairingSession.cpp +++ b/src/protocols/secure_channel/tests/TestPairingSession.cpp @@ -70,8 +70,7 @@ void PairingSessionEncodeDecodeMRPParams(nlTestSuite * inSuite, void * inContext NL_TEST_ASSERT(inSuite, writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, - PairingSession::EncodeSessionParameters(TLV::ContextTag(1), MakeOptional(config), writer) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, PairingSession::EncodeSessionParameters(TLV::ContextTag(1), config, writer) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, writer.EndContainer(outerContainerType) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, writer.Finalize(&buf) == CHIP_NO_ERROR); From 2011f76fc0f1f5da3809de09352817726c1f6891 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 29 Feb 2024 21:46:24 +0100 Subject: [PATCH 10/19] MinMDNS skip interfaces without IPv4 addresses (#32356) IPv4 multicast require an IPv4 address to be present on a particular interface. Skip interfaces without IPv4 addresses in the default address policy. This avoids errors when trying to join the multicast group later on: MDNS failed to join multicast group on veth3cdf62f for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found --- .../minimal_mdns/AddressPolicy_LibNlImpl.cpp | 42 +++++++++++++++++-- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/src/lib/dnssd/minimal_mdns/AddressPolicy_LibNlImpl.cpp b/src/lib/dnssd/minimal_mdns/AddressPolicy_LibNlImpl.cpp index e73627f42321e3..b1802c8d25dffa 100644 --- a/src/lib/dnssd/minimal_mdns/AddressPolicy_LibNlImpl.cpp +++ b/src/lib/dnssd/minimal_mdns/AddressPolicy_LibNlImpl.cpp @@ -48,6 +48,7 @@ class AllListenIterator : public mdns::Minimal::ListenIterator nl_sock * mNlSocket = nullptr; nl_cache * mNlCache = nullptr; + nl_cache * mNlAddrCache = nullptr; nl_object * mCurrentLink = nullptr; IPAddressType mCurrentLinkType = IPAddressType::kUnknown; @@ -94,6 +95,12 @@ AllListenIterator::~AllListenIterator() mNlCache = nullptr; } + if (mNlAddrCache != nullptr) + { + nl_cache_free(mNlAddrCache); + mNlAddrCache = nullptr; + } + if (mNlSocket != nullptr) { nl_socket_free(mNlSocket); @@ -151,7 +158,6 @@ bool AllListenIterator::Next(InterfaceId * id, IPAddressType * type) while (true) { #if INET_CONFIG_ENABLE_IPV4 - // FOR IPv4, report all interfaces as 'try IPv4 here as well' if (mCurrentLinkType == IPAddressType::kIPv6) { mCurrentLinkType = IPAddressType::kIPv4; @@ -176,14 +182,42 @@ bool AllListenIterator::Next(InterfaceId * id, IPAddressType * type) continue; } - int idx = rtnl_link_get_ifindex(CurrentLink()); - if (idx == 0) + int ifindex = rtnl_link_get_ifindex(CurrentLink()); + if (ifindex == 0) { // Invalid index, move to the next interface continue; } - *id = InterfaceId(idx); + // For IPv4, report only interfaces which have an IPv4 address + if (mCurrentLinkType == IPAddressType::kIPv4) + { + if (mNlAddrCache == nullptr) + { + int result = rtnl_addr_alloc_cache(mNlSocket, &mNlAddrCache); + if (result != 0) + { + ChipLogError(Inet, "Failed to cache addresses"); + return false; + } + } + + // Find IPv4 address for this interface + struct rtnl_addr * filter = rtnl_addr_alloc(); + rtnl_addr_set_family(filter, AF_INET); + rtnl_addr_set_ifindex(filter, ifindex); + + struct nl_object * addr = nl_cache_find(mNlAddrCache, OBJ_CAST(filter)); + nl_object_put(OBJ_CAST(filter)); + + // No IPv4 address, skip this interface for IPv4. + if (addr == nullptr) + continue; + + nl_object_put(addr); + } + + *id = InterfaceId(ifindex); *type = mCurrentLinkType; // advancing should have set this return true; } From dbf587f330ca466e8fd416039f6fcf9c3aef5d65 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 29 Feb 2024 13:40:05 -0800 Subject: [PATCH 11/19] Update the JSON<->TLV Converter doc to align with implemantation (#32367) --- src/lib/support/jsontlv/README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/lib/support/jsontlv/README.md b/src/lib/support/jsontlv/README.md index 06de13398af7b1..acab3f52e917f6 100644 --- a/src/lib/support/jsontlv/README.md +++ b/src/lib/support/jsontlv/README.md @@ -9,15 +9,17 @@ Helper functions for converting TLV-encoded data to Json format and vice versa. The library supports - full bi-directional conversion for matter data model payloads -- Additional support for generic 32-bit unsigned integer ids using "implicit - profile tags": - - 8-bit IDs are encoded as `ContextTags`, which matches matter - specification for encoding field identifiers - - For IDs that are larger, they will be encoded as - `Implicit Profile Tags`. The reason for allowing such IDs is to support - json formats where keys contain ids typically found in paths, like - `{"1234:INT": 10}` meaning `"Attribute 1234 has value 10"`. +- When the MEI prefix encodes a standard/scoped source, the tag is encoded + using ContextSpecific tag if tag_id is less than or equal to UINT8_MAX, and + ImplicitProfile tag if tag_id is larger than UINT8_MAX. The reason for + allowing such IDs is to support json formats where keys contain ids + typically found in paths, like `{"1234:INT": 10}` meaning + `"Attribute 1234 has value 10"`. + +- When the MEI prefix encodes a manufacturer code, the tag is encoded using + FullyQualified_6Bytes tag, the Vendor ID SHALL be set to the manufacturer + code, the profile number set to 0 and the tag number set to the MEI suffix. ### Format details @@ -75,12 +77,13 @@ limitations of this format are: - TLV List types are not supported. - TLV Array cannot contain another TLV Array. - The top-level container MUST be an anonymous STRUCT. -- Elements of the TLV Structure MUST have Context or Implicit Profile Tags. +- Elements of the TLV Structure MUST have Context or Implicit Profile Tags for + standard/scoped source and Fully Qualified Profile Tags for an MC source. - Implicit Profile Tag number MUST be larger or equal to 256 and smaller than 2^32 + 1. - TLV Structure element MUST be sorted by tag numbers from low to high, where sorted elements with Context Tags MUST appear first followed by sorted - elements with Implicit Profile Tags. + elements with Implicit Profile Tags and then Profile Specific Tags. ## Format Example @@ -120,6 +123,7 @@ elements, arrays, and structures. "8:DOUBLE" : 17.9, // 17.9 as double "9:FLOAT" : 17.9, // 17.9 as float "10:FLOAT" : "-Infinity", // Negative infinity float + "4293984426:UINT" : 3, // Vendor ID = 0xFFF1, Profile ID = 0, Tag ID = 0x00AA "contact:11:STRUCT" : { // structure example with field_name in the Json name "name:1:STRING" : "John", "age:2:UINT" : 34, From 2b1d7e11a0fe48daa6ffcdb7b86b017fa6dcd7e9 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 29 Feb 2024 17:50:20 -0500 Subject: [PATCH 12/19] Clean up some includes in DataModelHandler (#32381) * Clean up some includes in DataModelHandler Clean up includes and useless file comment. Overall the naming of this file is somewhat questionable as it contains a single init call. Still looking to determine if we should rename (we probably should). * Add back a missing header --- src/app/util/DataModelHandler.cpp | 6 ------ src/app/util/DataModelHandler.h | 12 ------------ 2 files changed, 18 deletions(-) diff --git a/src/app/util/DataModelHandler.cpp b/src/app/util/DataModelHandler.cpp index 8a37bd4cd7f5a9..6a4f7659bb3d33 100644 --- a/src/app/util/DataModelHandler.cpp +++ b/src/app/util/DataModelHandler.cpp @@ -14,12 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -/** - * @file - * This file implements the handler for data model messages. - */ - #include #include diff --git a/src/app/util/DataModelHandler.h b/src/app/util/DataModelHandler.h index 025d9b56f76fe2..d1ad0c2a61c051 100644 --- a/src/app/util/DataModelHandler.h +++ b/src/app/util/DataModelHandler.h @@ -14,22 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -/** - * @file - * This file defines the API for the handler for data model messages. - */ - #pragma once -#include -#include -#include -#include - /** * Initialize the data model internal code to be ready to send and receive * data model messages. - * */ void InitDataModelHandler(); From 42727b157e2f4914c1ba1e2668ae76e5e4207a08 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 29 Feb 2024 18:38:19 -0500 Subject: [PATCH 13/19] Rename `src/util/message.cpp` to `src/util/strings.cpp` and add appropriate headers (#32379) * Move things from message, update dependencies * Fix lint * Restyle * Remove wrongly copied comment * Add another dependency * Vendor identifiers is not orphaned anymore * Move strings to ember-strings to not have overlap in names * Add include for the cpp file into its own header * Standard ordering for attribute metadata cpp * Update darwin framework xcode file * Also move the copy string functions into ember strings. header af.h and implementation in util.cpp makes no sense --- .github/workflows/lint.yml | 2 - .../DefaultAttributePersistenceProvider.cpp | 1 + src/app/chip_data_model.cmake | 1 - src/app/chip_data_model.gni | 3 +- src/app/common/BUILD.gn | 6 ++ src/app/util/BUILD.gn | 10 +++ src/app/util/af.h | 13 --- src/app/util/attribute-metadata.cpp | 29 +++++++ src/app/util/attribute-metadata.h | 11 --- src/app/util/attribute-storage.cpp | 11 +-- src/app/util/ember-strings.cpp | 83 +++++++++++++++++++ src/app/util/ember-strings.h | 45 ++++++++++ src/app/util/message.cpp | 37 --------- src/app/util/mock/BUILD.gn | 1 + src/app/util/mock/attribute-storage.cpp | 29 ------- src/app/util/types_stub.h | 2 +- src/app/util/util.cpp | 48 +---------- .../templates/app/attributes/Accessors.zapt | 1 + .../Matter.xcodeproj/project.pbxproj | 18 ++-- src/lib/core/BUILD.gn | 9 +- .../zap-generated/attributes/Accessors.h | 1 + 21 files changed, 199 insertions(+), 162 deletions(-) create mode 100644 src/app/util/attribute-metadata.cpp create mode 100644 src/app/util/ember-strings.cpp create mode 100644 src/app/util/ember-strings.h delete mode 100644 src/app/util/message.cpp diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a5398ccb7567a2..dca562c57bf2f1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -123,12 +123,10 @@ jobs: --known-failure app/util/generic-callback-stubs.cpp \ --known-failure app/util/im-client-callbacks.h \ --known-failure app/util/MatterCallbacks.h \ - --known-failure app/util/message.cpp \ --known-failure app/util/odd-sized-integers.h \ --known-failure app/util/util.cpp \ --known-failure app/util/util.h \ --known-failure app/WriteHandler.h \ - --known-failure lib/core/CHIPVendorIdentifiers.hpp \ --known-failure platform/DeviceSafeQueue.cpp \ --known-failure platform/DeviceSafeQueue.h \ --known-failure platform/GLibTypeDeleter.h \ diff --git a/src/app/DefaultAttributePersistenceProvider.cpp b/src/app/DefaultAttributePersistenceProvider.cpp index 36497704a94a87..5bef4c11fb8c1a 100644 --- a/src/app/DefaultAttributePersistenceProvider.cpp +++ b/src/app/DefaultAttributePersistenceProvider.cpp @@ -15,6 +15,7 @@ */ #include +#include #include #include #include diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake index 610986a6186d8f..6e84ce2a4c6734 100644 --- a/src/app/chip_data_model.cmake +++ b/src/app/chip_data_model.cmake @@ -144,7 +144,6 @@ function(chip_configure_data_model APP_TARGET) ${CHIP_APP_BASE_DIR}/util/DataModelHandler.cpp ${CHIP_APP_BASE_DIR}/util/ember-compatibility-functions.cpp ${CHIP_APP_BASE_DIR}/util/generic-callback-stubs.cpp - ${CHIP_APP_BASE_DIR}/util/message.cpp ${CHIP_APP_BASE_DIR}/util/privilege-storage.cpp ${CHIP_APP_BASE_DIR}/util/util.cpp ${APP_GEN_FILES} diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 29c5f0399737cc..8131546e4e8a11 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -215,7 +215,6 @@ template("chip_data_model") { "${_app_root}/util/binding-table.cpp", "${_app_root}/util/binding-table.h", "${_app_root}/util/generic-callback-stubs.cpp", - "${_app_root}/util/message.cpp", "${_app_root}/util/privilege-storage.cpp", "${chip_root}/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp", ] @@ -418,8 +417,10 @@ template("chip_data_model") { ":${_data_model_name}_codegen", ":${_data_model_name}_zapgen", "${chip_root}/src/app", + "${chip_root}/src/app/common:attribute-type", "${chip_root}/src/app/common:cluster-objects", "${chip_root}/src/app/common:enums", + "${chip_root}/src/app/util:types", "${chip_root}/src/controller", "${chip_root}/src/lib/core", "${chip_root}/src/lib/support", diff --git a/src/app/common/BUILD.gn b/src/app/common/BUILD.gn index de7eef3008588d..b1ad03e9da261f 100644 --- a/src/app/common/BUILD.gn +++ b/src/app/common/BUILD.gn @@ -18,6 +18,12 @@ config("includes") { include_dirs = [ "${chip_root}/zzz_generated/app-common" ] } +source_set("attribute-type") { + sources = [ "${chip_root}/zzz_generated/app-common/app-common/zap-generated/attribute-type.h" ] + + public_configs = [ ":includes" ] +} + source_set("ids") { sources = [ "${chip_root}/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h", diff --git a/src/app/util/BUILD.gn b/src/app/util/BUILD.gn index 821ba51a9badcc..e5e4d22a549311 100644 --- a/src/app/util/BUILD.gn +++ b/src/app/util/BUILD.gn @@ -17,8 +17,18 @@ import("${chip_root}/src/app/common_flags.gni") source_set("types") { sources = [ + "attribute-metadata.cpp", "attribute-metadata.h", "basic-types.h", + "ember-strings.cpp", + "ember-strings.h", "types_stub.h", ] + + deps = [ + "${chip_root}/src/app/common:attribute-type", + "${chip_root}/src/lib/core:encoding", + "${chip_root}/src/lib/core:types", + ] + public_configs = [ "${chip_root}/src:includes" ] } diff --git a/src/app/util/af.h b/src/app/util/af.h index f7f772a4f2f4d2..1d428729f98b13 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -194,19 +194,6 @@ uint16_t emberAfFixedEndpointCount(void); */ bool emberAfIsTypeSigned(EmberAfAttributeType dataType); -/* - * @brief Function that copies a ZCL string type into a buffer. The size - * parameter should indicate the maximum number of characters to copy to the - * destination buffer not including the length byte. - */ -void emberAfCopyString(uint8_t * dest, const uint8_t * src, size_t size); -/* - * @brief Function that copies a ZCL long string into a buffer. The size - * parameter should indicate the maximum number of characters to copy to the - * destination buffer not including the length bytes. - */ -void emberAfCopyLongString(uint8_t * dest, const uint8_t * src, size_t size); - /** @} END Attribute Storage */ /** @name Device Control */ diff --git a/src/app/util/attribute-metadata.cpp b/src/app/util/attribute-metadata.cpp new file mode 100644 index 00000000000000..bf649a93004a22 --- /dev/null +++ b/src/app/util/attribute-metadata.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * 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. + */ +#include + +#include + +bool emberAfIsStringAttributeType(EmberAfAttributeType attributeType) +{ + return (attributeType == ZCL_OCTET_STRING_ATTRIBUTE_TYPE || attributeType == ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +bool emberAfIsLongStringAttributeType(EmberAfAttributeType attributeType) +{ + return (attributeType == ZCL_LONG_OCTET_STRING_ATTRIBUTE_TYPE || attributeType == ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE); +} diff --git a/src/app/util/attribute-metadata.h b/src/app/util/attribute-metadata.h index 0f9c9b26258758..a380599a8f48b6 100644 --- a/src/app/util/attribute-metadata.h +++ b/src/app/util/attribute-metadata.h @@ -198,14 +198,3 @@ bool emberAfIsStringAttributeType(EmberAfAttributeType attributeType); /** @brief Returns true if the given attribute type is a long string. */ bool emberAfIsLongStringAttributeType(EmberAfAttributeType attributeType); - -/* - * @brief Function that determines the length of a zigbee Cluster Library string - * (where the first byte is assumed to be the length). - */ -uint8_t emberAfStringLength(const uint8_t * buffer); -/* - * @brief Function that determines the length of a zigbee Cluster Library long string. - * (where the first two bytes are assumed to be the length). - */ -uint16_t emberAfLongStringLength(const uint8_t * buffer); diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 0b94cc8f4c211c..35fd9ce2437974 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -342,16 +343,6 @@ bool emberAfEndpointIndexIsEnabled(uint16_t index) return (emAfEndpoints[index].bitmask.Has(EmberAfEndpointOptions::isEnabled)); } -bool emberAfIsStringAttributeType(EmberAfAttributeType attributeType) -{ - return (attributeType == ZCL_OCTET_STRING_ATTRIBUTE_TYPE || attributeType == ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -bool emberAfIsLongStringAttributeType(EmberAfAttributeType attributeType) -{ - return (attributeType == ZCL_LONG_OCTET_STRING_ATTRIBUTE_TYPE || attributeType == ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE); -} - bool emberAfIsThisDataTypeAListType(EmberAfAttributeType dataType) { return dataType == ZCL_ARRAY_ATTRIBUTE_TYPE; diff --git a/src/app/util/ember-strings.cpp b/src/app/util/ember-strings.cpp new file mode 100644 index 00000000000000..efdc0a837b4f65 --- /dev/null +++ b/src/app/util/ember-strings.cpp @@ -0,0 +1,83 @@ +/** + * + * Copyright (c) 2020 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. + */ +#include + +#include + +using namespace chip; + +uint8_t emberAfStringLength(const uint8_t * buffer) +{ + // The first byte specifies the length of the string. A length of 0xFF means + // the string is invalid and there is no character data. + return (buffer[0] == 0xFF ? 0 : buffer[0]); +} + +uint16_t emberAfLongStringLength(const uint8_t * buffer) +{ + // The first two bytes specify the length of the long string. A length of + // 0xFFFF means the string is invalid and there is no character data. + uint16_t length = Encoding::LittleEndian::Get16(buffer); + return (length == 0xFFFF ? 0 : length); +} + +void emberAfCopyString(uint8_t * dest, const uint8_t * src, size_t size) +{ + if (src == nullptr) + { + dest[0] = 0; // Zero out the length of string + } + else if (src[0] == 0xFF) + { + dest[0] = src[0]; + } + else + { + uint8_t length = emberAfStringLength(src); + if (size < length) + { + // Since we have checked that size < length, size must be able to fit into the type of length. + length = static_cast(size); + } + memmove(dest + 1, src + 1, length); + dest[0] = length; + } +} + +void emberAfCopyLongString(uint8_t * dest, const uint8_t * src, size_t size) +{ + if (src == nullptr) + { + dest[0] = dest[1] = 0; // Zero out the length of string + } + else if ((src[0] == 0xFF) && (src[1] == 0xFF)) + { + dest[0] = 0xFF; + dest[1] = 0xFF; + } + else + { + uint16_t length = emberAfLongStringLength(src); + if (size < length) + { + // Since we have checked that size < length, size must be able to fit into the type of length. + length = static_cast(size); + } + memmove(dest + 2, src + 2, length); + Encoding::LittleEndian::Put16(dest, length); + } +} diff --git a/src/app/util/ember-strings.h b/src/app/util/ember-strings.h new file mode 100644 index 00000000000000..69c9695cc12c2a --- /dev/null +++ b/src/app/util/ember-strings.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * 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. + */ +#pragma once + +#include +#include + +/* + * @brief Function that determines the length of a zigbee Cluster Library string + * (where the first byte is assumed to be the length). + */ +uint8_t emberAfStringLength(const uint8_t * buffer); +/* + * @brief Function that determines the length of a zigbee Cluster Library long string. + * (where the first two bytes are assumed to be the length). + */ +uint16_t emberAfLongStringLength(const uint8_t * buffer); + +/* + * @brief Function that copies a ZCL string type into a buffer. The size + * parameter should indicate the maximum number of characters to copy to the + * destination buffer not including the length byte. + */ +void emberAfCopyString(uint8_t * dest, const uint8_t * src, size_t size); + +/* + * @brief Function that copies a ZCL long string into a buffer. The size + * parameter should indicate the maximum number of characters to copy to the + * destination buffer not including the length bytes. + */ +void emberAfCopyLongString(uint8_t * dest, const uint8_t * src, size_t size); diff --git a/src/app/util/message.cpp b/src/app/util/message.cpp deleted file mode 100644 index d48b5152815641..00000000000000 --- a/src/app/util/message.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - * Copyright (c) 2020 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. - */ - -#include -#include -#include - -using namespace chip; - -uint8_t emberAfStringLength(const uint8_t * buffer) -{ - // The first byte specifies the length of the string. A length of 0xFF means - // the string is invalid and there is no character data. - return (buffer[0] == 0xFF ? 0 : buffer[0]); -} - -uint16_t emberAfLongStringLength(const uint8_t * buffer) -{ - // The first two bytes specify the length of the long string. A length of - // 0xFFFF means the string is invalid and there is no character data. - uint16_t length = Encoding::LittleEndian::Get16(buffer); - return (length == 0xFFFF ? 0 : length); -} diff --git a/src/app/util/mock/BUILD.gn b/src/app/util/mock/BUILD.gn index be56bc69032844..da44fb84e5a809 100644 --- a/src/app/util/mock/BUILD.gn +++ b/src/app/util/mock/BUILD.gn @@ -29,6 +29,7 @@ source_set("mock_ember") { public_deps = [ "${chip_root}/src/app", + "${chip_root}/src/app/common:attribute-type", "${chip_root}/src/lib/core", "${chip_root}/src/lib/support", "${chip_root}/src/lib/support:testing_nlunit", diff --git a/src/app/util/mock/attribute-storage.cpp b/src/app/util/mock/attribute-storage.cpp index ec47dc061dbd8a..ab3bff265a7ee2 100644 --- a/src/app/util/mock/attribute-storage.cpp +++ b/src/app/util/mock/attribute-storage.cpp @@ -234,35 +234,6 @@ bool emberAfEndpointIndexIsEnabled(uint16_t index) return index < GetMockNodeConfig().endpoints.size(); } -// This duplication of basic utilities is really unfortunate, but we can't link -// to the normal attribute-storage.cpp because we redefine some of its symbols -// above. -bool emberAfIsStringAttributeType(EmberAfAttributeType attributeType) -{ - return (attributeType == ZCL_OCTET_STRING_ATTRIBUTE_TYPE || attributeType == ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -bool emberAfIsLongStringAttributeType(EmberAfAttributeType attributeType) -{ - return (attributeType == ZCL_LONG_OCTET_STRING_ATTRIBUTE_TYPE || attributeType == ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE); -} - -// And we don't have a good way to link to message.cpp either. -uint8_t emberAfStringLength(const uint8_t * buffer) -{ - // The first byte specifies the length of the string. A length of 0xFF means - // the string is invalid and there is no character data. - return (buffer[0] == 0xFF ? 0 : buffer[0]); -} - -uint16_t emberAfLongStringLength(const uint8_t * buffer) -{ - // The first two bytes specify the length of the long string. A length of - // 0xFFFF means the string is invalid and there is no character data. - uint16_t length = Encoding::LittleEndian::Get16(buffer); - return (length == 0xFFFF ? 0 : length); -} - // This will find the first server that has the clusterId given from the index of endpoint. bool emberAfContainsServerFromIndex(uint16_t index, ClusterId clusterId) { diff --git a/src/app/util/types_stub.h b/src/app/util/types_stub.h index dbd1ea184169e1..fd789da788b01d 100644 --- a/src/app/util/types_stub.h +++ b/src/app/util/types_stub.h @@ -20,9 +20,9 @@ #include // For mem* functions. #include +#include #include -#include static_assert(sizeof(chip::NodeId) == sizeof(uint64_t), "Unexpected node if size"); /** diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index e8163547d94d53..9c64d1bf3e8dca 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -192,53 +193,6 @@ uint16_t emberAfFindClusterNameIndex(ClusterId cluster) return 0xFFFF; } -void emberAfCopyString(uint8_t * dest, const uint8_t * src, size_t size) -{ - if (src == nullptr) - { - dest[0] = 0; // Zero out the length of string - } - else if (src[0] == 0xFF) - { - dest[0] = src[0]; - } - else - { - uint8_t length = emberAfStringLength(src); - if (size < length) - { - // Since we have checked that size < length, size must be able to fit into the type of length. - length = static_cast(size); - } - memmove(dest + 1, src + 1, length); - dest[0] = length; - } -} - -void emberAfCopyLongString(uint8_t * dest, const uint8_t * src, size_t size) -{ - if (src == nullptr) - { - dest[0] = dest[1] = 0; // Zero out the length of string - } - else if ((src[0] == 0xFF) && (src[1] == 0xFF)) - { - dest[0] = 0xFF; - dest[1] = 0xFF; - } - else - { - uint16_t length = emberAfLongStringLength(src); - if (size < length) - { - // Since we have checked that size < length, size must be able to fit into the type of length. - length = static_cast(size); - } - memmove(dest + 2, src + 2, length); - Encoding::LittleEndian::Put16(dest, length); - } -} - #if (CHIP_CONFIG_BIG_ENDIAN_TARGET) #define EM_BIG_ENDIAN true #else diff --git a/src/app/zap-templates/templates/app/attributes/Accessors.zapt b/src/app/zap-templates/templates/app/attributes/Accessors.zapt index cacbc2335a40b6..be70fb092983ec 100644 --- a/src/app/zap-templates/templates/app/attributes/Accessors.zapt +++ b/src/app/zap-templates/templates/app/attributes/Accessors.zapt @@ -9,6 +9,7 @@ #include #include +#include #include #include #include diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 7b316d9c434000..1fd4928ff96017 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -154,8 +154,6 @@ 514C79F42B62ED5500DD6D7B /* attribute-storage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C79F22B62ED5500DD6D7B /* attribute-storage.cpp */; }; 514C79F62B62F0B900DD6D7B /* util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C79F52B62F0B900DD6D7B /* util.cpp */; }; 514C79F72B62F0B900DD6D7B /* util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C79F52B62F0B900DD6D7B /* util.cpp */; }; - 514C79F92B62F60100DD6D7B /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C79F82B62F60100DD6D7B /* message.cpp */; }; - 514C79FA2B62F60100DD6D7B /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C79F82B62F60100DD6D7B /* message.cpp */; }; 514C79FC2B62F94C00DD6D7B /* ota-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C79FB2B62F94C00DD6D7B /* ota-provider.cpp */; }; 514C79FD2B62F94C00DD6D7B /* ota-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C79FB2B62F94C00DD6D7B /* ota-provider.cpp */; }; 514C7A012B64223400DD6D7B /* MTRServerAttribute_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C79FF2B64223400DD6D7B /* MTRServerAttribute_Internal.h */; }; @@ -259,6 +257,10 @@ 75B0D01E2B71B47F002074DD /* MTRDeviceTestDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 75B0D01D2B71B47F002074DD /* MTRDeviceTestDelegate.m */; }; 75B765C12A1D71BC0014719B /* MTRAttributeSpecifiedCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 75B765C02A1D71BC0014719B /* MTRAttributeSpecifiedCheck.h */; }; 75B765C32A1D82D30014719B /* MTRAttributeSpecifiedCheck.mm in Sources */ = {isa = PBXBuildFile; fileRef = 75B765C22A1D82D30014719B /* MTRAttributeSpecifiedCheck.mm */; }; + 75D532752B91194D009C64E4 /* ember-strings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75D532742B91194D009C64E4 /* ember-strings.cpp */; }; + 75D532762B91194D009C64E4 /* ember-strings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75D532742B91194D009C64E4 /* ember-strings.cpp */; }; + 75D532782B91195B009C64E4 /* attribute-metadata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75D532772B91195B009C64E4 /* attribute-metadata.cpp */; }; + 75D532792B91195B009C64E4 /* attribute-metadata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75D532772B91195B009C64E4 /* attribute-metadata.cpp */; }; 8874C1322B69C7060084BEFD /* MTRMetricsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8874C1312B69C7060084BEFD /* MTRMetricsTests.m */; }; 88E6C9462B6334ED001A1FE0 /* MTRMetrics.h in Headers */ = {isa = PBXBuildFile; fileRef = 88E6C9432B6334ED001A1FE0 /* MTRMetrics.h */; settings = {ATTRIBUTES = (Public, ); }; }; 88E6C9472B6334ED001A1FE0 /* MTRMetrics_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 88E6C9442B6334ED001A1FE0 /* MTRMetrics_Internal.h */; }; @@ -549,7 +551,6 @@ 514C79EF2B62ADDA00DD6D7B /* descriptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = descriptor.cpp; path = clusters/descriptor/descriptor.cpp; sourceTree = ""; }; 514C79F22B62ED5500DD6D7B /* attribute-storage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "attribute-storage.cpp"; path = "util/attribute-storage.cpp"; sourceTree = ""; }; 514C79F52B62F0B900DD6D7B /* util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = util.cpp; path = util/util.cpp; sourceTree = ""; }; - 514C79F82B62F60100DD6D7B /* message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = message.cpp; path = util/message.cpp; sourceTree = ""; }; 514C79FB2B62F94C00DD6D7B /* ota-provider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "ota-provider.cpp"; path = "clusters/ota-provider/ota-provider.cpp"; sourceTree = ""; }; 514C79FF2B64223400DD6D7B /* MTRServerAttribute_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRServerAttribute_Internal.h; sourceTree = ""; }; 514C7A002B64223400DD6D7B /* MTRServerEndpoint_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRServerEndpoint_Internal.h; sourceTree = ""; }; @@ -660,6 +661,8 @@ 75B765BF2A1D70F80014719B /* MTRAttributeSpecifiedCheck-src.zapt */ = {isa = PBXFileReference; lastKnownFileType = text; path = "MTRAttributeSpecifiedCheck-src.zapt"; sourceTree = ""; }; 75B765C02A1D71BC0014719B /* MTRAttributeSpecifiedCheck.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRAttributeSpecifiedCheck.h; sourceTree = ""; }; 75B765C22A1D82D30014719B /* MTRAttributeSpecifiedCheck.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRAttributeSpecifiedCheck.mm; sourceTree = ""; }; + 75D532742B91194D009C64E4 /* ember-strings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "ember-strings.cpp"; path = "util/ember-strings.cpp"; sourceTree = ""; }; + 75D532772B91195B009C64E4 /* attribute-metadata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "attribute-metadata.cpp"; path = "util/attribute-metadata.cpp"; sourceTree = ""; }; 8874C1312B69C7060084BEFD /* MTRMetricsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRMetricsTests.m; sourceTree = ""; }; 88E6C9432B6334ED001A1FE0 /* MTRMetrics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRMetrics.h; sourceTree = ""; }; 88E6C9442B6334ED001A1FE0 /* MTRMetrics_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRMetrics_Internal.h; sourceTree = ""; }; @@ -997,13 +1000,14 @@ 1E857311265519DE0050A4D9 /* app */ = { isa = PBXGroup; children = ( + 75D532772B91195B009C64E4 /* attribute-metadata.cpp */, + 75D532742B91194D009C64E4 /* ember-strings.cpp */, 5143041F2914CED9004DC7FE /* generic-callback-stubs.cpp */, 514C79F22B62ED5500DD6D7B /* attribute-storage.cpp */, 514C79EF2B62ADDA00DD6D7B /* descriptor.cpp */, 514C79EC2B62ADCD00DD6D7B /* ember-compatibility-functions.cpp */, 516415FE2B6B132200D5CE11 /* DataModelHandler.cpp */, 514C79F52B62F0B900DD6D7B /* util.cpp */, - 514C79F82B62F60100DD6D7B /* message.cpp */, 514C79FB2B62F94C00DD6D7B /* ota-provider.cpp */, ); name = app; @@ -1764,6 +1768,7 @@ B45373BD2A9FEA9100807602 /* service.c in Sources */, 0395469E2991DFC5006D42A8 /* json_writer.cpp in Sources */, 03FB93E02A46200A0048CB35 /* DiscoverCommissionablesCommand.mm in Sources */, + 75D532762B91194D009C64E4 /* ember-strings.cpp in Sources */, B45373EF2A9FEBFE00807602 /* ops-raw-skt.c in Sources */, 516411332B6BF77700E67C05 /* MTRServerAccessControl.mm in Sources */, 037C3DD52991C2E200B7EEE2 /* CHIPCommandBridge.mm in Sources */, @@ -1778,6 +1783,7 @@ B45373AA2A9FE73400807602 /* WebSocketServer.cpp in Sources */, B45373E62A9FEBA400807602 /* header.c in Sources */, B45374002A9FEC4F00807602 /* unix-init.c in Sources */, + 75D532792B91195B009C64E4 /* attribute-metadata.cpp in Sources */, B45373DF2A9FEB6F00807602 /* system.c in Sources */, B45373FC2A9FEC4F00807602 /* unix-caps.c in Sources */, B4E262162AA0CF1C00DBA5BC /* RemoteDataModelLogger.mm in Sources */, @@ -1811,7 +1817,6 @@ 037C3DCF2991BD5200B7EEE2 /* MTRError.mm in Sources */, 037C3DC72991BD5100B7EEE2 /* CHIPToolKeypair.mm in Sources */, B45373E52A9FEBA400807602 /* date.c in Sources */, - 514C79FA2B62F60100DD6D7B /* message.cpp in Sources */, 514C79F72B62F0B900DD6D7B /* util.cpp in Sources */, B45373DC2A9FEB5300807602 /* sha-1.c in Sources */, B45373D12A9FEB0C00807602 /* alloc.c in Sources */, @@ -1833,7 +1838,6 @@ files = ( 2C8C8FC2253E0C2100797F05 /* MTRPersistentStorageDelegateBridge.mm in Sources */, 99AECC802798A57F00B6355B /* MTRCommissioningParameters.mm in Sources */, - 514C79F92B62F60100DD6D7B /* message.cpp in Sources */, 2CB7163C252E8A7C0026E2BB /* MTRDeviceControllerDelegateBridge.mm in Sources */, 997DED162695343400975E97 /* MTRThreadOperationalDataset.mm in Sources */, 515C1C6F284F9FFB00A48F0C /* MTRFramework.mm in Sources */, @@ -1844,6 +1848,7 @@ 516416012B6B483C00D5CE11 /* MTRIMDispatch.mm in Sources */, 51D0B1412B61B3A4006E3511 /* MTRServerCluster.mm in Sources */, 514C79FC2B62F94C00DD6D7B /* ota-provider.cpp in Sources */, + 75D532752B91194D009C64E4 /* ember-strings.cpp in Sources */, 5136661428067D550025EDAE /* MTRDeviceControllerFactory.mm in Sources */, 51D0B1392B618CC6006E3511 /* MTRServerAttribute.mm in Sources */, 51B22C2A2740CB47008D5055 /* MTRCommandPayloadsObjc.mm in Sources */, @@ -1880,6 +1885,7 @@ 5A6FEC9627B5983000F25F42 /* MTRDeviceControllerXPCConnection.mm in Sources */, 511913FB28C100EF009235E9 /* MTRBaseSubscriptionCallback.mm in Sources */, 510470FB2A2F7DF60053EA7E /* MTRBackwardsCompatShims.mm in Sources */, + 75D532782B91195B009C64E4 /* attribute-metadata.cpp in Sources */, 5173A47629C0E2ED00F67F48 /* MTRFabricInfo.mm in Sources */, 5ACDDD7D27CD16D200EFD68A /* MTRClusterStateCacheContainer.mm in Sources */, 513DDB8A2761F6F900DAA01A /* MTRAttributeTLVValueDecoder.mm in Sources */, diff --git a/src/lib/core/BUILD.gn b/src/lib/core/BUILD.gn index 9163cafd85fe0c..fdb74c74d504c9 100644 --- a/src/lib/core/BUILD.gn +++ b/src/lib/core/BUILD.gn @@ -113,9 +113,14 @@ source_set("encoding") { source_set("types") { sources = [ "CHIPSafeCasts.h", + "CHIPVendorIdentifiers.hpp", + "DataModelTypes.h", "Global.h", + "GroupId.h", "InPlace.h", + "NodeId.h", "Optional.h", + "PasscodeId.h", "ReferenceCounted.h", "Unchecked.h", ] @@ -138,12 +143,8 @@ static_library("core") { "CHIPKeyIds.h", "CHIPPersistentStorageDelegate.h", "ClusterEnums.h", - "DataModelTypes.h", - "GroupId.h", - "NodeId.h", "OTAImageHeader.cpp", "OTAImageHeader.h", - "PasscodeId.h", "PeerId.h", "ScopedNodeId.h", "TLV.h", diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 51e19658e9d99d..3a35e3511a6747 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include From a9866068155410a6f0aba6d1fc38ffbf3dad6ac4 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 29 Feb 2024 21:00:45 -0500 Subject: [PATCH 14/19] Cleanup some unused functionality from `app/util/util.cpp` (#32382) * Remove unused zclClusterNames method and usage. Intent is to make util.cpp less dependent on generated code * Remove one more undefined and never used definition --- src/app/common/templates/templates.json | 5 - src/app/util/util.cpp | 37 - src/app/util/util.h | 10 - .../templates/app/print-cluster.zapt | 26 - .../app-common/zap-generated/print-cluster.h | 921 ------------------ 5 files changed, 999 deletions(-) delete mode 100644 src/app/zap-templates/templates/app/print-cluster.zapt delete mode 100644 zzz_generated/app-common/app-common/zap-generated/print-cluster.h diff --git a/src/app/common/templates/templates.json b/src/app/common/templates/templates.json index de26d76697d0ad..9c1ef210532b95 100644 --- a/src/app/common/templates/templates.json +++ b/src/app/common/templates/templates.json @@ -45,11 +45,6 @@ "name": "ZCL callback header", "output": "callback.h" }, - { - "path": "../../zap-templates/templates/app/print-cluster.zapt", - "name": "ZCL print-cluster header", - "output": "print-cluster.h" - }, { "path": "../../zap-templates/templates/app/attributes/Accessors.zapt", "name": "Attributes Accessors header", diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index 9c64d1bf3e8dca..aba9f3b217babf 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -41,23 +40,6 @@ using namespace chip; using chip::Protocols::InteractionModel::Status; -//------------------------------------------------------------------------------ -// Forward Declarations - -//------------------------------------------------------------------------------ -// Globals - -const EmberAfClusterName zclClusterNames[] = { - CLUSTER_IDS_TO_NAMES // defined in print-cluster.h - { kInvalidClusterId, nullptr }, // terminator -}; - -#ifdef MATTER_DM_GENERATED_PLUGIN_TICK_FUNCTION_DECLARATIONS -MATTER_DM_GENERATED_PLUGIN_TICK_FUNCTION_DECLARATIONS -#endif - -//------------------------------------------------------------------------------ - // Is the device identifying? bool emberAfIsDeviceIdentifying(EndpointId endpoint) { @@ -174,25 +156,6 @@ void MatterPowerTopologyPluginServerInitCallback() {} void MatterElectricalEnergyMeasurementPluginServerInitCallback() {} void MatterElectricalPowerMeasurementPluginServerInitCallback() {} -// **************************************** -// Print out information about each cluster -// **************************************** - -uint16_t emberAfFindClusterNameIndex(ClusterId cluster) -{ - static_assert(sizeof(ClusterId) == 4, "May need to adjust our index type or somehow define it in terms of cluster id type"); - uint16_t index = 0; - while (zclClusterNames[index].id != kInvalidClusterId) - { - if (zclClusterNames[index].id == cluster) - { - return index; - } - index++; - } - return 0xFFFF; -} - #if (CHIP_CONFIG_BIG_ENDIAN_TARGET) #define EM_BIG_ENDIAN true #else diff --git a/src/app/util/util.h b/src/app/util/util.h index ab13ba1768d085..6d84a7c0ee947f 100644 --- a/src/app/util/util.h +++ b/src/app/util/util.h @@ -22,17 +22,7 @@ #include #include -// Cluster name structure -typedef struct -{ - chip::ClusterId id; - const char * name; -} EmberAfClusterName; - -extern const EmberAfClusterName zclClusterNames[]; - void emberAfInit(); -uint16_t emberAfFindClusterNameIndex(chip::ClusterId cluster); /** * Retrieves the difference between the two passed values. diff --git a/src/app/zap-templates/templates/app/print-cluster.zapt b/src/app/zap-templates/templates/app/print-cluster.zapt deleted file mode 100644 index 3d1a17d764d224..00000000000000 --- a/src/app/zap-templates/templates/app/print-cluster.zapt +++ /dev/null @@ -1,26 +0,0 @@ -{{> header}} - -// Prevent multiple inclusion -#pragma once - -#include - -// This is the mapping of IDs to cluster names assuming a format according -// to the "EmberAfClusterName" defined in the ZCL header. -// The names of clusters that are not present, are removed. - -{{#zcl_clusters}} -#if defined(ZCL_USING_{{asDelimitedMacro this.define}}_SERVER) || defined(ZCL_USING_{{asDelimitedMacro this.define}}_CLIENT) - #define CHIP_PRINTCLUSTER_{{asDelimitedMacro this.define}} { chip::app::Clusters::{{asUpperCamelCase this.label}}::Id, "{{this.label}}" }, -#else - #define CHIP_PRINTCLUSTER_{{asDelimitedMacro this.define}} -#endif - -{{/zcl_clusters}} - -#define CLUSTER_IDS_TO_NAMES \ -{{#zcl_clusters}} - CHIP_PRINTCLUSTER_{{asDelimitedMacro this.define}} \ -{{/zcl_clusters}} - -#define MAX_CLUSTER_NAME_LENGTH {{zcl_cluster_largest_label_length}} diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h deleted file mode 100644 index a6af06565cf074..00000000000000 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ /dev/null @@ -1,921 +0,0 @@ -/* - * - * Copyright (c) 2022 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. - */ - -// THIS FILE IS GENERATED BY ZAP - -// Prevent multiple inclusion -#pragma once - -#include - -// This is the mapping of IDs to cluster names assuming a format according -// to the "EmberAfClusterName" defined in the ZCL header. -// The names of clusters that are not present, are removed. - -#if defined(ZCL_USING_IDENTIFY_CLUSTER_SERVER) || defined(ZCL_USING_IDENTIFY_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_IDENTIFY_CLUSTER { chip::app::Clusters::Identify::Id, "Identify" }, -#else -#define CHIP_PRINTCLUSTER_IDENTIFY_CLUSTER -#endif - -#if defined(ZCL_USING_GROUPS_CLUSTER_SERVER) || defined(ZCL_USING_GROUPS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_GROUPS_CLUSTER { chip::app::Clusters::Groups::Id, "Groups" }, -#else -#define CHIP_PRINTCLUSTER_GROUPS_CLUSTER -#endif - -#if defined(ZCL_USING_ON_OFF_CLUSTER_SERVER) || defined(ZCL_USING_ON_OFF_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ON_OFF_CLUSTER { chip::app::Clusters::OnOff::Id, "On/Off" }, -#else -#define CHIP_PRINTCLUSTER_ON_OFF_CLUSTER -#endif - -#if defined(ZCL_USING_ON_OFF_SWITCH_CONFIGURATION_CLUSTER_SERVER) || defined(ZCL_USING_ON_OFF_SWITCH_CONFIGURATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ON_OFF_SWITCH_CONFIGURATION_CLUSTER \ - { chip::app::Clusters::OnOffSwitchConfiguration::Id, "On/off Switch Configuration" }, -#else -#define CHIP_PRINTCLUSTER_ON_OFF_SWITCH_CONFIGURATION_CLUSTER -#endif - -#if defined(ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_LEVEL_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_LEVEL_CONTROL_CLUSTER { chip::app::Clusters::LevelControl::Id, "Level Control" }, -#else -#define CHIP_PRINTCLUSTER_LEVEL_CONTROL_CLUSTER -#endif - -#if defined(ZCL_USING_BINARY_INPUT_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_BINARY_INPUT_BASIC_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BINARY_INPUT_BASIC_CLUSTER { chip::app::Clusters::BinaryInputBasic::Id, "Binary Input (Basic)" }, -#else -#define CHIP_PRINTCLUSTER_BINARY_INPUT_BASIC_CLUSTER -#endif - -#if defined(ZCL_USING_PWM_CLUSTER_SERVER) || defined(ZCL_USING_PWM_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PWM_CLUSTER { chip::app::Clusters::PulseWidthModulation::Id, "Pulse Width Modulation" }, -#else -#define CHIP_PRINTCLUSTER_PWM_CLUSTER -#endif - -#if defined(ZCL_USING_DESCRIPTOR_CLUSTER_SERVER) || defined(ZCL_USING_DESCRIPTOR_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DESCRIPTOR_CLUSTER { chip::app::Clusters::Descriptor::Id, "Descriptor" }, -#else -#define CHIP_PRINTCLUSTER_DESCRIPTOR_CLUSTER -#endif - -#if defined(ZCL_USING_BINDING_CLUSTER_SERVER) || defined(ZCL_USING_BINDING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BINDING_CLUSTER { chip::app::Clusters::Binding::Id, "Binding" }, -#else -#define CHIP_PRINTCLUSTER_BINDING_CLUSTER -#endif - -#if defined(ZCL_USING_ACCESS_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_ACCESS_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ACCESS_CONTROL_CLUSTER { chip::app::Clusters::AccessControl::Id, "Access Control" }, -#else -#define CHIP_PRINTCLUSTER_ACCESS_CONTROL_CLUSTER -#endif - -#if defined(ZCL_USING_ACTIONS_CLUSTER_SERVER) || defined(ZCL_USING_ACTIONS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ACTIONS_CLUSTER { chip::app::Clusters::Actions::Id, "Actions" }, -#else -#define CHIP_PRINTCLUSTER_ACTIONS_CLUSTER -#endif - -#if defined(ZCL_USING_BASIC_INFORMATION_CLUSTER_SERVER) || defined(ZCL_USING_BASIC_INFORMATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BASIC_INFORMATION_CLUSTER { chip::app::Clusters::BasicInformation::Id, "Basic Information" }, -#else -#define CHIP_PRINTCLUSTER_BASIC_INFORMATION_CLUSTER -#endif - -#if defined(ZCL_USING_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER) || defined(ZCL_USING_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER \ - { chip::app::Clusters::OtaSoftwareUpdateProvider::Id, "OTA Software Update Provider" }, -#else -#define CHIP_PRINTCLUSTER_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER -#endif - -#if defined(ZCL_USING_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER_SERVER) || \ - defined(ZCL_USING_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER \ - { chip::app::Clusters::OtaSoftwareUpdateRequestor::Id, "OTA Software Update Requestor" }, -#else -#define CHIP_PRINTCLUSTER_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER -#endif - -#if defined(ZCL_USING_LOCALIZATION_CONFIGURATION_CLUSTER_SERVER) || defined(ZCL_USING_LOCALIZATION_CONFIGURATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_LOCALIZATION_CONFIGURATION_CLUSTER \ - { chip::app::Clusters::LocalizationConfiguration::Id, "Localization Configuration" }, -#else -#define CHIP_PRINTCLUSTER_LOCALIZATION_CONFIGURATION_CLUSTER -#endif - -#if defined(ZCL_USING_TIME_FORMAT_LOCALIZATION_CLUSTER_SERVER) || defined(ZCL_USING_TIME_FORMAT_LOCALIZATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TIME_FORMAT_LOCALIZATION_CLUSTER \ - { chip::app::Clusters::TimeFormatLocalization::Id, "Time Format Localization" }, -#else -#define CHIP_PRINTCLUSTER_TIME_FORMAT_LOCALIZATION_CLUSTER -#endif - -#if defined(ZCL_USING_UNIT_LOCALIZATION_CLUSTER_SERVER) || defined(ZCL_USING_UNIT_LOCALIZATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_UNIT_LOCALIZATION_CLUSTER { chip::app::Clusters::UnitLocalization::Id, "Unit Localization" }, -#else -#define CHIP_PRINTCLUSTER_UNIT_LOCALIZATION_CLUSTER -#endif - -#if defined(ZCL_USING_POWER_SOURCE_CONFIGURATION_CLUSTER_SERVER) || defined(ZCL_USING_POWER_SOURCE_CONFIGURATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_POWER_SOURCE_CONFIGURATION_CLUSTER \ - { chip::app::Clusters::PowerSourceConfiguration::Id, "Power Source Configuration" }, -#else -#define CHIP_PRINTCLUSTER_POWER_SOURCE_CONFIGURATION_CLUSTER -#endif - -#if defined(ZCL_USING_POWER_SOURCE_CLUSTER_SERVER) || defined(ZCL_USING_POWER_SOURCE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_POWER_SOURCE_CLUSTER { chip::app::Clusters::PowerSource::Id, "Power Source" }, -#else -#define CHIP_PRINTCLUSTER_POWER_SOURCE_CLUSTER -#endif - -#if defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER { chip::app::Clusters::GeneralCommissioning::Id, "General Commissioning" }, -#else -#define CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER -#endif - -#if defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER { chip::app::Clusters::NetworkCommissioning::Id, "Network Commissioning" }, -#else -#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER -#endif - -#if defined(ZCL_USING_DIAGNOSTIC_LOGS_CLUSTER_SERVER) || defined(ZCL_USING_DIAGNOSTIC_LOGS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DIAGNOSTIC_LOGS_CLUSTER { chip::app::Clusters::DiagnosticLogs::Id, "Diagnostic Logs" }, -#else -#define CHIP_PRINTCLUSTER_DIAGNOSTIC_LOGS_CLUSTER -#endif - -#if defined(ZCL_USING_GENERAL_DIAGNOSTICS_CLUSTER_SERVER) || defined(ZCL_USING_GENERAL_DIAGNOSTICS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_GENERAL_DIAGNOSTICS_CLUSTER { chip::app::Clusters::GeneralDiagnostics::Id, "General Diagnostics" }, -#else -#define CHIP_PRINTCLUSTER_GENERAL_DIAGNOSTICS_CLUSTER -#endif - -#if defined(ZCL_USING_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER) || defined(ZCL_USING_SOFTWARE_DIAGNOSTICS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_SOFTWARE_DIAGNOSTICS_CLUSTER { chip::app::Clusters::SoftwareDiagnostics::Id, "Software Diagnostics" }, -#else -#define CHIP_PRINTCLUSTER_SOFTWARE_DIAGNOSTICS_CLUSTER -#endif - -#if defined(ZCL_USING_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER) || defined(ZCL_USING_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_THREAD_NETWORK_DIAGNOSTICS_CLUSTER \ - { chip::app::Clusters::ThreadNetworkDiagnostics::Id, "Thread Network Diagnostics" }, -#else -#define CHIP_PRINTCLUSTER_THREAD_NETWORK_DIAGNOSTICS_CLUSTER -#endif - -#if defined(ZCL_USING_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER) || defined(ZCL_USING_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_WIFI_NETWORK_DIAGNOSTICS_CLUSTER \ - { chip::app::Clusters::WiFiNetworkDiagnostics::Id, "WiFi Network Diagnostics" }, -#else -#define CHIP_PRINTCLUSTER_WIFI_NETWORK_DIAGNOSTICS_CLUSTER -#endif - -#if defined(ZCL_USING_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_SERVER) || defined(ZCL_USING_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER \ - { chip::app::Clusters::EthernetNetworkDiagnostics::Id, "Ethernet Network Diagnostics" }, -#else -#define CHIP_PRINTCLUSTER_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER -#endif - -#if defined(ZCL_USING_TIME_SYNCHRONIZATION_CLUSTER_SERVER) || defined(ZCL_USING_TIME_SYNCHRONIZATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TIME_SYNCHRONIZATION_CLUSTER { chip::app::Clusters::TimeSynchronization::Id, "Time Synchronization" }, -#else -#define CHIP_PRINTCLUSTER_TIME_SYNCHRONIZATION_CLUSTER -#endif - -#if defined(ZCL_USING_BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER_SERVER) || \ - defined(ZCL_USING_BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER \ - { chip::app::Clusters::BridgedDeviceBasicInformation::Id, "Bridged Device Basic Information" }, -#else -#define CHIP_PRINTCLUSTER_BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER -#endif - -#if defined(ZCL_USING_SWITCH_CLUSTER_SERVER) || defined(ZCL_USING_SWITCH_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_SWITCH_CLUSTER { chip::app::Clusters::Switch::Id, "Switch" }, -#else -#define CHIP_PRINTCLUSTER_SWITCH_CLUSTER -#endif - -#if defined(ZCL_USING_ADMINISTRATOR_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_ADMINISTRATOR_COMMISSIONING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ADMINISTRATOR_COMMISSIONING_CLUSTER \ - { chip::app::Clusters::AdministratorCommissioning::Id, "Administrator Commissioning" }, -#else -#define CHIP_PRINTCLUSTER_ADMINISTRATOR_COMMISSIONING_CLUSTER -#endif - -#if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \ - { chip::app::Clusters::OperationalCredentials::Id, "Operational Credentials" }, -#else -#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER -#endif - -#if defined(ZCL_USING_GROUP_KEY_MANAGEMENT_CLUSTER_SERVER) || defined(ZCL_USING_GROUP_KEY_MANAGEMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_GROUP_KEY_MANAGEMENT_CLUSTER { chip::app::Clusters::GroupKeyManagement::Id, "Group Key Management" }, -#else -#define CHIP_PRINTCLUSTER_GROUP_KEY_MANAGEMENT_CLUSTER -#endif - -#if defined(ZCL_USING_FIXED_LABEL_CLUSTER_SERVER) || defined(ZCL_USING_FIXED_LABEL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_FIXED_LABEL_CLUSTER { chip::app::Clusters::FixedLabel::Id, "Fixed Label" }, -#else -#define CHIP_PRINTCLUSTER_FIXED_LABEL_CLUSTER -#endif - -#if defined(ZCL_USING_USER_LABEL_CLUSTER_SERVER) || defined(ZCL_USING_USER_LABEL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_USER_LABEL_CLUSTER { chip::app::Clusters::UserLabel::Id, "User Label" }, -#else -#define CHIP_PRINTCLUSTER_USER_LABEL_CLUSTER -#endif - -#if defined(ZCL_USING_PROXY_CONFIGURATION_CLUSTER_SERVER) || defined(ZCL_USING_PROXY_CONFIGURATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PROXY_CONFIGURATION_CLUSTER { chip::app::Clusters::ProxyConfiguration::Id, "Proxy Configuration" }, -#else -#define CHIP_PRINTCLUSTER_PROXY_CONFIGURATION_CLUSTER -#endif - -#if defined(ZCL_USING_PROXY_DISCOVERY_CLUSTER_SERVER) || defined(ZCL_USING_PROXY_DISCOVERY_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PROXY_DISCOVERY_CLUSTER { chip::app::Clusters::ProxyDiscovery::Id, "Proxy Discovery" }, -#else -#define CHIP_PRINTCLUSTER_PROXY_DISCOVERY_CLUSTER -#endif - -#if defined(ZCL_USING_PROXY_VALID_CLUSTER_SERVER) || defined(ZCL_USING_PROXY_VALID_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PROXY_VALID_CLUSTER { chip::app::Clusters::ProxyValid::Id, "Proxy Valid" }, -#else -#define CHIP_PRINTCLUSTER_PROXY_VALID_CLUSTER -#endif - -#if defined(ZCL_USING_BOOLEAN_STATE_CLUSTER_SERVER) || defined(ZCL_USING_BOOLEAN_STATE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BOOLEAN_STATE_CLUSTER { chip::app::Clusters::BooleanState::Id, "Boolean State" }, -#else -#define CHIP_PRINTCLUSTER_BOOLEAN_STATE_CLUSTER -#endif - -#if defined(ZCL_USING_ICD_MANAGEMENT_CLUSTER_SERVER) || defined(ZCL_USING_ICD_MANAGEMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ICD_MANAGEMENT_CLUSTER { chip::app::Clusters::IcdManagement::Id, "ICD Management" }, -#else -#define CHIP_PRINTCLUSTER_ICD_MANAGEMENT_CLUSTER -#endif - -#if defined(ZCL_USING_TIMER_CLUSTER_SERVER) || defined(ZCL_USING_TIMER_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TIMER_CLUSTER { chip::app::Clusters::Timer::Id, "Timer" }, -#else -#define CHIP_PRINTCLUSTER_TIMER_CLUSTER -#endif - -#if defined(ZCL_USING_OPERATIONAL_STATE_OVEN_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_STATE_OVEN_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_OVEN_CLUSTER \ - { chip::app::Clusters::OvenCavityOperationalState::Id, "Oven Cavity Operational State" }, -#else -#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_OVEN_CLUSTER -#endif - -#if defined(ZCL_USING_OVEN_MODE_CLUSTER_SERVER) || defined(ZCL_USING_OVEN_MODE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OVEN_MODE_CLUSTER { chip::app::Clusters::OvenMode::Id, "Oven Mode" }, -#else -#define CHIP_PRINTCLUSTER_OVEN_MODE_CLUSTER -#endif - -#if defined(ZCL_USING_LAUNDRY_DRYER_CONTROLS_CLUSTER_SERVER) || defined(ZCL_USING_LAUNDRY_DRYER_CONTROLS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_LAUNDRY_DRYER_CONTROLS_CLUSTER \ - { chip::app::Clusters::LaundryDryerControls::Id, "Laundry Dryer Controls" }, -#else -#define CHIP_PRINTCLUSTER_LAUNDRY_DRYER_CONTROLS_CLUSTER -#endif - -#if defined(ZCL_USING_MODE_SELECT_CLUSTER_SERVER) || defined(ZCL_USING_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER { chip::app::Clusters::ModeSelect::Id, "Mode Select" }, -#else -#define CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER -#endif - -#if defined(ZCL_USING_LAUNDRY_WASHER_MODE_CLUSTER_SERVER) || defined(ZCL_USING_LAUNDRY_WASHER_MODE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_CLUSTER { chip::app::Clusters::LaundryWasherMode::Id, "Laundry Washer Mode" }, -#else -#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_CLUSTER -#endif - -#if defined(ZCL_USING_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_SERVER) || \ - defined(ZCL_USING_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER \ - { chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, \ - "Refrigerator And Temperature Controlled Cabinet Mode" }, -#else -#define CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER -#endif - -#if defined(ZCL_USING_LAUNDRY_WASHER_CONTROLS_CLUSTER_SERVER) || defined(ZCL_USING_LAUNDRY_WASHER_CONTROLS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_CONTROLS_CLUSTER \ - { chip::app::Clusters::LaundryWasherControls::Id, "Laundry Washer Controls" }, -#else -#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_CONTROLS_CLUSTER -#endif - -#if defined(ZCL_USING_RVC_RUN_MODE_CLUSTER_SERVER) || defined(ZCL_USING_RVC_RUN_MODE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_RVC_RUN_MODE_CLUSTER { chip::app::Clusters::RvcRunMode::Id, "RVC Run Mode" }, -#else -#define CHIP_PRINTCLUSTER_RVC_RUN_MODE_CLUSTER -#endif - -#if defined(ZCL_USING_RVC_CLEAN_MODE_CLUSTER_SERVER) || defined(ZCL_USING_RVC_CLEAN_MODE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_CLUSTER { chip::app::Clusters::RvcCleanMode::Id, "RVC Clean Mode" }, -#else -#define CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_CLUSTER -#endif - -#if defined(ZCL_USING_TEMPERATURE_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_TEMPERATURE_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TEMPERATURE_CONTROL_CLUSTER { chip::app::Clusters::TemperatureControl::Id, "Temperature Control" }, -#else -#define CHIP_PRINTCLUSTER_TEMPERATURE_CONTROL_CLUSTER -#endif - -#if defined(ZCL_USING_REFRIGERATOR_ALARM_CLUSTER_SERVER) || defined(ZCL_USING_REFRIGERATOR_ALARM_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_REFRIGERATOR_ALARM_CLUSTER { chip::app::Clusters::RefrigeratorAlarm::Id, "Refrigerator Alarm" }, -#else -#define CHIP_PRINTCLUSTER_REFRIGERATOR_ALARM_CLUSTER -#endif - -#if defined(ZCL_USING_DISHWASHER_MODE_CLUSTER_SERVER) || defined(ZCL_USING_DISHWASHER_MODE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DISHWASHER_MODE_CLUSTER { chip::app::Clusters::DishwasherMode::Id, "Dishwasher Mode" }, -#else -#define CHIP_PRINTCLUSTER_DISHWASHER_MODE_CLUSTER -#endif - -#if defined(ZCL_USING_AIR_QUALITY_CLUSTER_SERVER) || defined(ZCL_USING_AIR_QUALITY_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER { chip::app::Clusters::AirQuality::Id, "Air Quality" }, -#else -#define CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER -#endif - -#if defined(ZCL_USING_SMOKE_CO_ALARM_CLUSTER_SERVER) || defined(ZCL_USING_SMOKE_CO_ALARM_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER { chip::app::Clusters::SmokeCoAlarm::Id, "Smoke CO Alarm" }, -#else -#define CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER -#endif - -#if defined(ZCL_USING_DISHWASHER_ALARM_CLUSTER_SERVER) || defined(ZCL_USING_DISHWASHER_ALARM_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DISHWASHER_ALARM_CLUSTER { chip::app::Clusters::DishwasherAlarm::Id, "Dishwasher Alarm" }, -#else -#define CHIP_PRINTCLUSTER_DISHWASHER_ALARM_CLUSTER -#endif - -#if defined(ZCL_USING_MICROWAVE_OVEN_MODE_CLUSTER_SERVER) || defined(ZCL_USING_MICROWAVE_OVEN_MODE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_MICROWAVE_OVEN_MODE_CLUSTER { chip::app::Clusters::MicrowaveOvenMode::Id, "Microwave Oven Mode" }, -#else -#define CHIP_PRINTCLUSTER_MICROWAVE_OVEN_MODE_CLUSTER -#endif - -#if defined(ZCL_USING_MICROWAVE_OVEN_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_MICROWAVE_OVEN_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_MICROWAVE_OVEN_CONTROL_CLUSTER \ - { chip::app::Clusters::MicrowaveOvenControl::Id, "Microwave Oven Control" }, -#else -#define CHIP_PRINTCLUSTER_MICROWAVE_OVEN_CONTROL_CLUSTER -#endif - -#if defined(ZCL_USING_OPERATIONAL_STATE_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_STATE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER { chip::app::Clusters::OperationalState::Id, "Operational State" }, -#else -#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER -#endif - -#if defined(ZCL_USING_OPERATIONAL_STATE_RVC_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_STATE_RVC_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER { chip::app::Clusters::RvcOperationalState::Id, "RVC Operational State" }, -#else -#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER -#endif - -#if defined(ZCL_USING_SCENES_CLUSTER_SERVER) || defined(ZCL_USING_SCENES_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_SCENES_CLUSTER { chip::app::Clusters::ScenesManagement::Id, "Scenes Management" }, -#else -#define CHIP_PRINTCLUSTER_SCENES_CLUSTER -#endif - -#if defined(ZCL_USING_HEPA_FILTER_MONITORING_CLUSTER_SERVER) || defined(ZCL_USING_HEPA_FILTER_MONITORING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ - { chip::app::Clusters::HepaFilterMonitoring::Id, "HEPA Filter Monitoring" }, -#else -#define CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER -#endif - -#if defined(ZCL_USING_ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_SERVER) || \ - defined(ZCL_USING_ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER \ - { chip::app::Clusters::ActivatedCarbonFilterMonitoring::Id, "Activated Carbon Filter Monitoring" }, -#else -#define CHIP_PRINTCLUSTER_ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER -#endif - -#if defined(ZCL_USING_BOOLEAN_STATE_CONFIGURATION_CLUSTER_SERVER) || defined(ZCL_USING_BOOLEAN_STATE_CONFIGURATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BOOLEAN_STATE_CONFIGURATION_CLUSTER \ - { chip::app::Clusters::BooleanStateConfiguration::Id, "Boolean State Configuration" }, -#else -#define CHIP_PRINTCLUSTER_BOOLEAN_STATE_CONFIGURATION_CLUSTER -#endif - -#if defined(ZCL_USING_VALVE_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER) || \ - defined(ZCL_USING_VALVE_CONFIGURATION_AND_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_VALVE_CONFIGURATION_AND_CONTROL_CLUSTER \ - { chip::app::Clusters::ValveConfigurationAndControl::Id, "Valve Configuration and Control" }, -#else -#define CHIP_PRINTCLUSTER_VALVE_CONFIGURATION_AND_CONTROL_CLUSTER -#endif - -#if defined(ZCL_USING_ELECTRICAL_POWER_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_ELECTRICAL_POWER_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ELECTRICAL_POWER_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::ElectricalPowerMeasurement::Id, "Electrical Power Measurement" }, -#else -#define CHIP_PRINTCLUSTER_ELECTRICAL_POWER_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::ElectricalEnergyMeasurement::Id, "Electrical Energy Measurement" }, -#else -#define CHIP_PRINTCLUSTER_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER \ - { chip::app::Clusters::DemandResponseLoadControl::Id, "Demand Response Load Control" }, -#else -#define CHIP_PRINTCLUSTER_DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER -#endif - -#if defined(ZCL_USING_MESSAGES_CLUSTER_SERVER) || defined(ZCL_USING_MESSAGES_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_MESSAGES_CLUSTER { chip::app::Clusters::Messages::Id, "Messages" }, -#else -#define CHIP_PRINTCLUSTER_MESSAGES_CLUSTER -#endif - -#if defined(ZCL_USING_DEVICE_ENERGY_MANAGEMENT_CLUSTER_SERVER) || defined(ZCL_USING_DEVICE_ENERGY_MANAGEMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DEVICE_ENERGY_MANAGEMENT_CLUSTER \ - { chip::app::Clusters::DeviceEnergyManagement::Id, "Device Energy Management" }, -#else -#define CHIP_PRINTCLUSTER_DEVICE_ENERGY_MANAGEMENT_CLUSTER -#endif - -#if defined(ZCL_USING_ENERGY_EVSE_CLUSTER_SERVER) || defined(ZCL_USING_ENERGY_EVSE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ENERGY_EVSE_CLUSTER { chip::app::Clusters::EnergyEvse::Id, "Energy EVSE" }, -#else -#define CHIP_PRINTCLUSTER_ENERGY_EVSE_CLUSTER -#endif - -#if defined(ZCL_USING_ENERGY_PREFERENCE_CLUSTER_SERVER) || defined(ZCL_USING_ENERGY_PREFERENCE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ENERGY_PREFERENCE_CLUSTER { chip::app::Clusters::EnergyPreference::Id, "Energy Preference" }, -#else -#define CHIP_PRINTCLUSTER_ENERGY_PREFERENCE_CLUSTER -#endif - -#if defined(ZCL_USING_POWER_TOPOLOGY_CLUSTER_SERVER) || defined(ZCL_USING_POWER_TOPOLOGY_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_POWER_TOPOLOGY_CLUSTER { chip::app::Clusters::PowerTopology::Id, "Power Topology" }, -#else -#define CHIP_PRINTCLUSTER_POWER_TOPOLOGY_CLUSTER -#endif - -#if defined(ZCL_USING_ENERGY_EVSE_MODE_CLUSTER_SERVER) || defined(ZCL_USING_ENERGY_EVSE_MODE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ENERGY_EVSE_MODE_CLUSTER { chip::app::Clusters::EnergyEvseMode::Id, "Energy EVSE Mode" }, -#else -#define CHIP_PRINTCLUSTER_ENERGY_EVSE_MODE_CLUSTER -#endif - -#if defined(ZCL_USING_DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER_SERVER) || \ - defined(ZCL_USING_DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER \ - { chip::app::Clusters::DeviceEnergyManagementMode::Id, "Device Energy Management Mode" }, -#else -#define CHIP_PRINTCLUSTER_DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER -#endif - -#if defined(ZCL_USING_DOOR_LOCK_CLUSTER_SERVER) || defined(ZCL_USING_DOOR_LOCK_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER { chip::app::Clusters::DoorLock::Id, "Door Lock" }, -#else -#define CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER -#endif - -#if defined(ZCL_USING_WINDOW_COVERING_CLUSTER_SERVER) || defined(ZCL_USING_WINDOW_COVERING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER { chip::app::Clusters::WindowCovering::Id, "Window Covering" }, -#else -#define CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER -#endif - -#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BARRIER_CONTROL_CLUSTER { chip::app::Clusters::BarrierControl::Id, "Barrier Control" }, -#else -#define CHIP_PRINTCLUSTER_BARRIER_CONTROL_CLUSTER -#endif - -#if defined(ZCL_USING_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER) || \ - defined(ZCL_USING_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER \ - { chip::app::Clusters::PumpConfigurationAndControl::Id, "Pump Configuration and Control" }, -#else -#define CHIP_PRINTCLUSTER_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER -#endif - -#if defined(ZCL_USING_THERMOSTAT_CLUSTER_SERVER) || defined(ZCL_USING_THERMOSTAT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_THERMOSTAT_CLUSTER { chip::app::Clusters::Thermostat::Id, "Thermostat" }, -#else -#define CHIP_PRINTCLUSTER_THERMOSTAT_CLUSTER -#endif - -#if defined(ZCL_USING_FAN_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_FAN_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_FAN_CONTROL_CLUSTER { chip::app::Clusters::FanControl::Id, "Fan Control" }, -#else -#define CHIP_PRINTCLUSTER_FAN_CONTROL_CLUSTER -#endif - -#if defined(ZCL_USING_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_SERVER) || \ - defined(ZCL_USING_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER \ - { chip::app::Clusters::ThermostatUserInterfaceConfiguration::Id, "Thermostat User Interface Configuration" }, -#else -#define CHIP_PRINTCLUSTER_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER -#endif - -#if defined(ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_COLOR_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_COLOR_CONTROL_CLUSTER { chip::app::Clusters::ColorControl::Id, "Color Control" }, -#else -#define CHIP_PRINTCLUSTER_COLOR_CONTROL_CLUSTER -#endif - -#if defined(ZCL_USING_BALLAST_CONFIGURATION_CLUSTER_SERVER) || defined(ZCL_USING_BALLAST_CONFIGURATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BALLAST_CONFIGURATION_CLUSTER { chip::app::Clusters::BallastConfiguration::Id, "Ballast Configuration" }, -#else -#define CHIP_PRINTCLUSTER_BALLAST_CONFIGURATION_CLUSTER -#endif - -#if defined(ZCL_USING_ILLUMINANCE_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_ILLUMINANCE_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ILLUMINANCE_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::IlluminanceMeasurement::Id, "Illuminance Measurement" }, -#else -#define CHIP_PRINTCLUSTER_ILLUMINANCE_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_TEMPERATURE_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_TEMPERATURE_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TEMPERATURE_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::TemperatureMeasurement::Id, "Temperature Measurement" }, -#else -#define CHIP_PRINTCLUSTER_TEMPERATURE_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_PRESSURE_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_PRESSURE_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PRESSURE_MEASUREMENT_CLUSTER { chip::app::Clusters::PressureMeasurement::Id, "Pressure Measurement" }, -#else -#define CHIP_PRINTCLUSTER_PRESSURE_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_FLOW_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_FLOW_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_FLOW_MEASUREMENT_CLUSTER { chip::app::Clusters::FlowMeasurement::Id, "Flow Measurement" }, -#else -#define CHIP_PRINTCLUSTER_FLOW_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::RelativeHumidityMeasurement::Id, "Relative Humidity Measurement" }, -#else -#define CHIP_PRINTCLUSTER_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_OCCUPANCY_SENSING_CLUSTER_SERVER) || defined(ZCL_USING_OCCUPANCY_SENSING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OCCUPANCY_SENSING_CLUSTER { chip::app::Clusters::OccupancySensing::Id, "Occupancy Sensing" }, -#else -#define CHIP_PRINTCLUSTER_OCCUPANCY_SENSING_CLUSTER -#endif - -#if defined(ZCL_USING_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Id, "Carbon Monoxide Concentration Measurement" }, -#else -#define CHIP_PRINTCLUSTER_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Id, "Carbon Dioxide Concentration Measurement" }, -#else -#define CHIP_PRINTCLUSTER_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Id, "Nitrogen Dioxide Concentration Measurement" }, -#else -#define CHIP_PRINTCLUSTER_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_OZONE_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_OZONE_CONCENTRATION_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OZONE_CONCENTRATION_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::OzoneConcentrationMeasurement::Id, "Ozone Concentration Measurement" }, -#else -#define CHIP_PRINTCLUSTER_OZONE_CONCENTRATION_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_PM2_5_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_PM2_5_CONCENTRATION_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PM2_5_CONCENTRATION_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::Pm25ConcentrationMeasurement::Id, "PM2.5 Concentration Measurement" }, -#else -#define CHIP_PRINTCLUSTER_PM2_5_CONCENTRATION_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_FORMALDEHYDE_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_FORMALDEHYDE_CONCENTRATION_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_FORMALDEHYDE_CONCENTRATION_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::FormaldehydeConcentrationMeasurement::Id, "Formaldehyde Concentration Measurement" }, -#else -#define CHIP_PRINTCLUSTER_FORMALDEHYDE_CONCENTRATION_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_PM1_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_PM1_CONCENTRATION_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PM1_CONCENTRATION_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::Pm1ConcentrationMeasurement::Id, "PM1 Concentration Measurement" }, -#else -#define CHIP_PRINTCLUSTER_PM1_CONCENTRATION_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_PM10_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_PM10_CONCENTRATION_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PM10_CONCENTRATION_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::Pm10ConcentrationMeasurement::Id, "PM10 Concentration Measurement" }, -#else -#define CHIP_PRINTCLUSTER_PM10_CONCENTRATION_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_TVOC_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_TVOC_CONCENTRATION_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TVOC_CONCENTRATION_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, \ - "Total Volatile Organic Compounds Concentration Measurement" }, -#else -#define CHIP_PRINTCLUSTER_TVOC_CONCENTRATION_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_RADON_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER) || \ - defined(ZCL_USING_RADON_CONCENTRATION_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_RADON_CONCENTRATION_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::RadonConcentrationMeasurement::Id, "Radon Concentration Measurement" }, -#else -#define CHIP_PRINTCLUSTER_RADON_CONCENTRATION_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_WAKE_ON_LAN_CLUSTER_SERVER) || defined(ZCL_USING_WAKE_ON_LAN_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_WAKE_ON_LAN_CLUSTER { chip::app::Clusters::WakeOnLan::Id, "Wake on LAN" }, -#else -#define CHIP_PRINTCLUSTER_WAKE_ON_LAN_CLUSTER -#endif - -#if defined(ZCL_USING_CHANNEL_CLUSTER_SERVER) || defined(ZCL_USING_CHANNEL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_CHANNEL_CLUSTER { chip::app::Clusters::Channel::Id, "Channel" }, -#else -#define CHIP_PRINTCLUSTER_CHANNEL_CLUSTER -#endif - -#if defined(ZCL_USING_TARGET_NAVIGATOR_CLUSTER_SERVER) || defined(ZCL_USING_TARGET_NAVIGATOR_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TARGET_NAVIGATOR_CLUSTER { chip::app::Clusters::TargetNavigator::Id, "Target Navigator" }, -#else -#define CHIP_PRINTCLUSTER_TARGET_NAVIGATOR_CLUSTER -#endif - -#if defined(ZCL_USING_MEDIA_PLAYBACK_CLUSTER_SERVER) || defined(ZCL_USING_MEDIA_PLAYBACK_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_MEDIA_PLAYBACK_CLUSTER { chip::app::Clusters::MediaPlayback::Id, "Media Playback" }, -#else -#define CHIP_PRINTCLUSTER_MEDIA_PLAYBACK_CLUSTER -#endif - -#if defined(ZCL_USING_MEDIA_INPUT_CLUSTER_SERVER) || defined(ZCL_USING_MEDIA_INPUT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_MEDIA_INPUT_CLUSTER { chip::app::Clusters::MediaInput::Id, "Media Input" }, -#else -#define CHIP_PRINTCLUSTER_MEDIA_INPUT_CLUSTER -#endif - -#if defined(ZCL_USING_LOW_POWER_CLUSTER_SERVER) || defined(ZCL_USING_LOW_POWER_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_LOW_POWER_CLUSTER { chip::app::Clusters::LowPower::Id, "Low Power" }, -#else -#define CHIP_PRINTCLUSTER_LOW_POWER_CLUSTER -#endif - -#if defined(ZCL_USING_KEYPAD_INPUT_CLUSTER_SERVER) || defined(ZCL_USING_KEYPAD_INPUT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_KEYPAD_INPUT_CLUSTER { chip::app::Clusters::KeypadInput::Id, "Keypad Input" }, -#else -#define CHIP_PRINTCLUSTER_KEYPAD_INPUT_CLUSTER -#endif - -#if defined(ZCL_USING_CONTENT_LAUNCHER_CLUSTER_SERVER) || defined(ZCL_USING_CONTENT_LAUNCHER_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_CONTENT_LAUNCHER_CLUSTER { chip::app::Clusters::ContentLauncher::Id, "Content Launcher" }, -#else -#define CHIP_PRINTCLUSTER_CONTENT_LAUNCHER_CLUSTER -#endif - -#if defined(ZCL_USING_AUDIO_OUTPUT_CLUSTER_SERVER) || defined(ZCL_USING_AUDIO_OUTPUT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_AUDIO_OUTPUT_CLUSTER { chip::app::Clusters::AudioOutput::Id, "Audio Output" }, -#else -#define CHIP_PRINTCLUSTER_AUDIO_OUTPUT_CLUSTER -#endif - -#if defined(ZCL_USING_APPLICATION_LAUNCHER_CLUSTER_SERVER) || defined(ZCL_USING_APPLICATION_LAUNCHER_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER { chip::app::Clusters::ApplicationLauncher::Id, "Application Launcher" }, -#else -#define CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER -#endif - -#if defined(ZCL_USING_APPLICATION_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_APPLICATION_BASIC_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER { chip::app::Clusters::ApplicationBasic::Id, "Application Basic" }, -#else -#define CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER -#endif - -#if defined(ZCL_USING_ACCOUNT_LOGIN_CLUSTER_SERVER) || defined(ZCL_USING_ACCOUNT_LOGIN_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER { chip::app::Clusters::AccountLogin::Id, "Account Login" }, -#else -#define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER -#endif - -#if defined(ZCL_USING_CONTENT_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_CONTENT_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_CONTENT_CONTROL_CLUSTER { chip::app::Clusters::ContentControl::Id, "Content Control" }, -#else -#define CHIP_PRINTCLUSTER_CONTENT_CONTROL_CLUSTER -#endif - -#if defined(ZCL_USING_CONTENT_APP_OBSERVER_CLUSTER_SERVER) || defined(ZCL_USING_CONTENT_APP_OBSERVER_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_CONTENT_APP_OBSERVER_CLUSTER { chip::app::Clusters::ContentAppObserver::Id, "Content App Observer" }, -#else -#define CHIP_PRINTCLUSTER_CONTENT_APP_OBSERVER_CLUSTER -#endif - -#if defined(ZCL_USING_ELECTRICAL_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_ELECTRICAL_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ - { chip::app::Clusters::ElectricalMeasurement::Id, "Electrical Measurement" }, -#else -#define CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER -#endif - -#if defined(ZCL_USING_UNIT_TESTING_CLUSTER_SERVER) || defined(ZCL_USING_UNIT_TESTING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER { chip::app::Clusters::UnitTesting::Id, "Unit Testing" }, -#else -#define CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER -#endif - -#if defined(ZCL_USING_FAULT_INJECTION_CLUSTER_SERVER) || defined(ZCL_USING_FAULT_INJECTION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER { chip::app::Clusters::FaultInjection::Id, "Fault Injection" }, -#else -#define CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER -#endif - -#if defined(ZCL_USING_SAMPLE_MEI_CLUSTER_SERVER) || defined(ZCL_USING_SAMPLE_MEI_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_SAMPLE_MEI_CLUSTER { chip::app::Clusters::SampleMei::Id, "Sample MEI" }, -#else -#define CHIP_PRINTCLUSTER_SAMPLE_MEI_CLUSTER -#endif - -#define CLUSTER_IDS_TO_NAMES \ - CHIP_PRINTCLUSTER_IDENTIFY_CLUSTER \ - CHIP_PRINTCLUSTER_GROUPS_CLUSTER \ - CHIP_PRINTCLUSTER_ON_OFF_CLUSTER \ - CHIP_PRINTCLUSTER_ON_OFF_SWITCH_CONFIGURATION_CLUSTER \ - CHIP_PRINTCLUSTER_LEVEL_CONTROL_CLUSTER \ - CHIP_PRINTCLUSTER_BINARY_INPUT_BASIC_CLUSTER \ - CHIP_PRINTCLUSTER_PWM_CLUSTER \ - CHIP_PRINTCLUSTER_DESCRIPTOR_CLUSTER \ - CHIP_PRINTCLUSTER_BINDING_CLUSTER \ - CHIP_PRINTCLUSTER_ACCESS_CONTROL_CLUSTER \ - CHIP_PRINTCLUSTER_ACTIONS_CLUSTER \ - CHIP_PRINTCLUSTER_BASIC_INFORMATION_CLUSTER \ - CHIP_PRINTCLUSTER_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER \ - CHIP_PRINTCLUSTER_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER \ - CHIP_PRINTCLUSTER_LOCALIZATION_CONFIGURATION_CLUSTER \ - CHIP_PRINTCLUSTER_TIME_FORMAT_LOCALIZATION_CLUSTER \ - CHIP_PRINTCLUSTER_UNIT_LOCALIZATION_CLUSTER \ - CHIP_PRINTCLUSTER_POWER_SOURCE_CONFIGURATION_CLUSTER \ - CHIP_PRINTCLUSTER_POWER_SOURCE_CLUSTER \ - CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \ - CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \ - CHIP_PRINTCLUSTER_DIAGNOSTIC_LOGS_CLUSTER \ - CHIP_PRINTCLUSTER_GENERAL_DIAGNOSTICS_CLUSTER \ - CHIP_PRINTCLUSTER_SOFTWARE_DIAGNOSTICS_CLUSTER \ - CHIP_PRINTCLUSTER_THREAD_NETWORK_DIAGNOSTICS_CLUSTER \ - CHIP_PRINTCLUSTER_WIFI_NETWORK_DIAGNOSTICS_CLUSTER \ - CHIP_PRINTCLUSTER_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER \ - CHIP_PRINTCLUSTER_TIME_SYNCHRONIZATION_CLUSTER \ - CHIP_PRINTCLUSTER_BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER \ - CHIP_PRINTCLUSTER_SWITCH_CLUSTER \ - CHIP_PRINTCLUSTER_ADMINISTRATOR_COMMISSIONING_CLUSTER \ - CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \ - CHIP_PRINTCLUSTER_GROUP_KEY_MANAGEMENT_CLUSTER \ - CHIP_PRINTCLUSTER_FIXED_LABEL_CLUSTER \ - CHIP_PRINTCLUSTER_USER_LABEL_CLUSTER \ - CHIP_PRINTCLUSTER_PROXY_CONFIGURATION_CLUSTER \ - CHIP_PRINTCLUSTER_PROXY_DISCOVERY_CLUSTER \ - CHIP_PRINTCLUSTER_PROXY_VALID_CLUSTER \ - CHIP_PRINTCLUSTER_BOOLEAN_STATE_CLUSTER \ - CHIP_PRINTCLUSTER_ICD_MANAGEMENT_CLUSTER \ - CHIP_PRINTCLUSTER_TIMER_CLUSTER \ - CHIP_PRINTCLUSTER_OPERATIONAL_STATE_OVEN_CLUSTER \ - CHIP_PRINTCLUSTER_OVEN_MODE_CLUSTER \ - CHIP_PRINTCLUSTER_LAUNDRY_DRYER_CONTROLS_CLUSTER \ - CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER \ - CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_CLUSTER \ - CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER \ - CHIP_PRINTCLUSTER_LAUNDRY_WASHER_CONTROLS_CLUSTER \ - CHIP_PRINTCLUSTER_RVC_RUN_MODE_CLUSTER \ - CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_CLUSTER \ - CHIP_PRINTCLUSTER_TEMPERATURE_CONTROL_CLUSTER \ - CHIP_PRINTCLUSTER_REFRIGERATOR_ALARM_CLUSTER \ - CHIP_PRINTCLUSTER_DISHWASHER_MODE_CLUSTER \ - CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER \ - CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER \ - CHIP_PRINTCLUSTER_DISHWASHER_ALARM_CLUSTER \ - CHIP_PRINTCLUSTER_MICROWAVE_OVEN_MODE_CLUSTER \ - CHIP_PRINTCLUSTER_MICROWAVE_OVEN_CONTROL_CLUSTER \ - CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER \ - CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER \ - CHIP_PRINTCLUSTER_SCENES_CLUSTER \ - CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ - CHIP_PRINTCLUSTER_ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER \ - CHIP_PRINTCLUSTER_BOOLEAN_STATE_CONFIGURATION_CLUSTER \ - CHIP_PRINTCLUSTER_VALVE_CONFIGURATION_AND_CONTROL_CLUSTER \ - CHIP_PRINTCLUSTER_ELECTRICAL_POWER_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER \ - CHIP_PRINTCLUSTER_MESSAGES_CLUSTER \ - CHIP_PRINTCLUSTER_DEVICE_ENERGY_MANAGEMENT_CLUSTER \ - CHIP_PRINTCLUSTER_ENERGY_EVSE_CLUSTER \ - CHIP_PRINTCLUSTER_ENERGY_PREFERENCE_CLUSTER \ - CHIP_PRINTCLUSTER_POWER_TOPOLOGY_CLUSTER \ - CHIP_PRINTCLUSTER_ENERGY_EVSE_MODE_CLUSTER \ - CHIP_PRINTCLUSTER_DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER \ - CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \ - CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \ - CHIP_PRINTCLUSTER_BARRIER_CONTROL_CLUSTER \ - CHIP_PRINTCLUSTER_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER \ - CHIP_PRINTCLUSTER_THERMOSTAT_CLUSTER \ - CHIP_PRINTCLUSTER_FAN_CONTROL_CLUSTER \ - CHIP_PRINTCLUSTER_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER \ - CHIP_PRINTCLUSTER_COLOR_CONTROL_CLUSTER \ - CHIP_PRINTCLUSTER_BALLAST_CONFIGURATION_CLUSTER \ - CHIP_PRINTCLUSTER_ILLUMINANCE_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_TEMPERATURE_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_PRESSURE_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_FLOW_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_OCCUPANCY_SENSING_CLUSTER \ - CHIP_PRINTCLUSTER_CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_OZONE_CONCENTRATION_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_PM2_5_CONCENTRATION_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_FORMALDEHYDE_CONCENTRATION_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_PM1_CONCENTRATION_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_PM10_CONCENTRATION_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_TVOC_CONCENTRATION_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_RADON_CONCENTRATION_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_WAKE_ON_LAN_CLUSTER \ - CHIP_PRINTCLUSTER_CHANNEL_CLUSTER \ - CHIP_PRINTCLUSTER_TARGET_NAVIGATOR_CLUSTER \ - CHIP_PRINTCLUSTER_MEDIA_PLAYBACK_CLUSTER \ - CHIP_PRINTCLUSTER_MEDIA_INPUT_CLUSTER \ - CHIP_PRINTCLUSTER_LOW_POWER_CLUSTER \ - CHIP_PRINTCLUSTER_KEYPAD_INPUT_CLUSTER \ - CHIP_PRINTCLUSTER_CONTENT_LAUNCHER_CLUSTER \ - CHIP_PRINTCLUSTER_AUDIO_OUTPUT_CLUSTER \ - CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ - CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ - CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ - CHIP_PRINTCLUSTER_CONTENT_CONTROL_CLUSTER \ - CHIP_PRINTCLUSTER_CONTENT_APP_OBSERVER_CLUSTER \ - CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ - CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER \ - CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER \ - CHIP_PRINTCLUSTER_SAMPLE_MEI_CLUSTER - -#define MAX_CLUSTER_NAME_LENGTH 58 From ac1ebc508d97dcde9e5606ca68ad72961589f11e Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 29 Feb 2024 21:59:14 -0500 Subject: [PATCH 15/19] Fix incorrect snapshotting of MRP config by CASE client. (#32380) * Fix incorrect snapshotting of MRP config by CASE client. Right now, we snapshot the MRP config as part of the CASEClientInitParams during stack startup. After that, we will use that snapshotted config whenever we are the CASE initiator. This config will not match the parameters we use as CASE responder or advertise over DNS-SD if the local MRP configuration ever changes. Which for an ICD it can. The fix is to stop the incorrect snapshotting and get the information we need from the right source of truth when we need it. * Address review comments. * Address issue with CASE session not assuming the right things when NullOptional is passed in. --- src/app/CASEClient.cpp | 5 ++++- src/app/CASEClient.h | 6 +++++- src/app/server/Server.cpp | 4 +++- src/controller/CHIPDeviceControllerFactory.cpp | 4 +++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/app/CASEClient.cpp b/src/app/CASEClient.cpp index 7ce5a539e6105a..5eef5088fd77c1 100644 --- a/src/app/CASEClient.cpp +++ b/src/app/CASEClient.cpp @@ -16,6 +16,7 @@ */ #include +#include namespace chip { @@ -49,10 +50,12 @@ CHIP_ERROR CASEClient::EstablishSession(const CASEClientInitParams & params, con Messaging::ExchangeContext * exchange = params.exchangeMgr->NewContext(session.Value(), &mCASESession); VerifyOrReturnError(exchange != nullptr, CHIP_ERROR_INTERNAL); + const Optional & mrpLocalConfig = + params.mrpLocalConfig.HasValue() ? params.mrpLocalConfig : GetLocalMRPConfig(); mCASESession.SetGroupDataProvider(params.groupDataProvider); ReturnErrorOnFailure(mCASESession.EstablishSession(*params.sessionManager, params.fabricTable, peer, exchange, params.sessionResumptionStorage, params.certificateValidityPolicy, delegate, - params.mrpLocalConfig)); + mrpLocalConfig)); return CHIP_NO_ERROR; } diff --git a/src/app/CASEClient.h b/src/app/CASEClient.h index b640ae066f0f09..7ef968d544165f 100644 --- a/src/app/CASEClient.h +++ b/src/app/CASEClient.h @@ -34,7 +34,11 @@ struct CASEClientInitParams Messaging::ExchangeManager * exchangeMgr = nullptr; FabricTable * fabricTable = nullptr; Credentials::GroupDataProvider * groupDataProvider = nullptr; - Optional mrpLocalConfig = Optional::Missing(); + + // mrpLocalConfig should not generally be set to anything other than + // NullOptional. Doing that can lead to different parts of the system + // claiming different MRP parameters for the same node. + Optional mrpLocalConfig = NullOptional; CHIP_ERROR Validate() const { diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index f2a562020091a3..e046080c1089a5 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -313,7 +313,9 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) .exchangeMgr = &mExchangeMgr, .fabricTable = &mFabrics, .groupDataProvider = mGroupsProvider, - .mrpLocalConfig = GetLocalMRPConfig(), + // Don't provide an MRP local config, so each CASE initiation will use + // the then-current value. + .mrpLocalConfig = NullOptional, }, .clientPool = &mCASEClientPool, .sessionSetupPool = &mSessionSetupPool, diff --git a/src/controller/CHIPDeviceControllerFactory.cpp b/src/controller/CHIPDeviceControllerFactory.cpp index ebc728ca206875..25bcd12b190a09 100644 --- a/src/controller/CHIPDeviceControllerFactory.cpp +++ b/src/controller/CHIPDeviceControllerFactory.cpp @@ -270,7 +270,9 @@ CHIP_ERROR DeviceControllerFactory::InitSystemState(FactoryInitParams params) .exchangeMgr = stateParams.exchangeMgr, .fabricTable = stateParams.fabricTable, .groupDataProvider = stateParams.groupDataProvider, - .mrpLocalConfig = GetLocalMRPConfig(), + // Don't provide an MRP local config, so each CASE initiation will use + // the then-current value. + .mrpLocalConfig = NullOptional, }; CASESessionManagerConfig sessionManagerConfig = { From 9189b790c7b6f713a40222ddec9ffb99742a05e7 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 1 Mar 2024 09:43:47 +0100 Subject: [PATCH 16/19] [Python] Use Python logging everywhere (#32383) Do not print to the console but use the Python logging module explicitly. --- src/controller/python/chip/ChipDeviceCtrl.py | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index 318c2b56ef3d4d..bf9bb245ec3461 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -34,6 +34,7 @@ import ctypes import enum import json +import logging import threading import time import typing @@ -265,9 +266,9 @@ def __init__(self, name: str = ''): def _set_dev_ctrl(self, devCtrl): def HandleCommissioningComplete(nodeid, err): if err.is_success: - print("Commissioning complete") + logging.info("Commissioning complete") else: - print("Failed to commission: {}".format(err)) + logging.warning("Failed to commission: {}".format(err)) self.state = DCState.IDLE self._ChipStack.callbackRes = err @@ -283,30 +284,30 @@ def HandleFabricCheck(nodeId): def HandleOpenWindowComplete(nodeid: int, setupPinCode: int, setupManualCode: str, setupQRCode: str, err: PyChipError) -> None: if err.is_success: - print("Open Commissioning Window complete setting nodeid {} pincode to {}".format(nodeid, setupPinCode)) + logging.info("Open Commissioning Window complete setting nodeid {} pincode to {}".format(nodeid, setupPinCode)) self._ChipStack.openCommissioningWindowPincode[nodeid] = CommissioningParameters( setupPinCode=setupPinCode, setupManualCode=setupManualCode.decode(), setupQRCode=setupQRCode.decode()) else: - print("Failed to open commissioning window: {}".format(err)) + logging.warning("Failed to open commissioning window: {}".format(err)) self._ChipStack.callbackRes = err self._ChipStack.completeEvent.set() def HandleUnpairDeviceComplete(nodeid: int, err: PyChipError): if err.is_success: - print("Succesfully unpaired device with nodeid {}".format(nodeid)) + logging.info("Succesfully unpaired device with nodeid {}".format(nodeid)) else: - print("Failed to unpair device: {}".format(err)) + logging.warning("Failed to unpair device: {}".format(err)) self._ChipStack.callbackRes = err self._ChipStack.completeEvent.set() def HandlePASEEstablishmentComplete(err: PyChipError): if not err.is_success: - print("Failed to establish secure session to device: {}".format(err)) + logging.warning("Failed to establish secure session to device: {}".format(err)) self._ChipStack.callbackRes = err.to_exception() else: - print("Established secure session with Device") + logging.info("Established secure session with Device") if self.state != DCState.COMMISSIONING: # During Commissioning, HandlePASEEstablishmentComplete will also be called, @@ -785,7 +786,7 @@ def GetConnectedDeviceSync(self, nodeid, allowPASE=True, timeoutMs: int = None): res = self._ChipStack.Call(lambda: self._dmLib.pychip_GetDeviceBeingCommissioned( self.devCtrl, nodeid, byref(returnDevice)), timeoutMs) if res.is_success: - print('Using PASE connection') + logging.info('Using PASE connection') return DeviceProxyWrapper(returnDevice) class DeviceAvailableClosure(): @@ -1151,7 +1152,7 @@ def _parseEventPathTuple(self, pathTuple: typing.Union[ # Wildcard pass elif not isinstance(pathTuple, tuple): - print(type(pathTuple)) + logging.debug(type(pathTuple)) if isinstance(pathTuple, int): endpoint = pathTuple elif issubclass(pathTuple, ClusterObjects.Cluster): @@ -1426,7 +1427,7 @@ def ZCLSend(self, cluster, command, nodeid, endpoint, groupid, args, blocking=Fa raise UnknownCommand(cluster, command) try: res = asyncio.run(self.SendCommand(nodeid, endpoint, req)) - print(f"CommandResponse {res}") + logging.debug(f"CommandResponse {res}") return (0, res) except InteractionModelError as ex: return (int(ex.status), None) From bd6866badd44b997bdd2c7cf838fe1010d0881ff Mon Sep 17 00:00:00 2001 From: Axel Le Bourhis <45206070+axelnxp@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:59:20 +0100 Subject: [PATCH 17/19] [NXP][Zephyr] Use common wifi port for Zephyr (#32143) * [NXP][Zephyr] Use common wifi port for Zephyr Move current NXP Zephyr wifi port to a common place, to be shared with other zephyr platforms. Signed-off-by: Axel Le Bourhis * Restyled by gn * [NXP][platform][zephyr] Lower CHIP task priority Lower CHIP task priority to give margin for higher priority system tasks. Signed-off-by: Axel Le Bourhis --------- Signed-off-by: Axel Le Bourhis Co-authored-by: Restyled.io --- .../wifi/ConnectivityManagerImplWiFi.cpp | 0 .../wifi/ConnectivityManagerImplWiFi.h | 0 .../zephyr => Zephyr}/wifi/WiFiManager.cpp | 0 .../{nxp/zephyr => Zephyr}/wifi/WiFiManager.h | 0 .../wifi/ZephyrWifiDriver.cpp} | 40 +++++++++---------- .../wifi/ZephyrWifiDriver.h} | 14 +++---- src/platform/nxp/zephyr/BUILD.gn | 12 +++--- .../nxp/zephyr/CHIPDevicePlatformConfig.h | 2 +- .../nxp/zephyr/ConnectivityManagerImpl.h | 2 +- .../zephyr/DiagnosticDataProviderImplNxp.cpp | 2 +- 10 files changed, 36 insertions(+), 36 deletions(-) rename src/platform/{nxp/zephyr => Zephyr}/wifi/ConnectivityManagerImplWiFi.cpp (100%) rename src/platform/{nxp/zephyr => Zephyr}/wifi/ConnectivityManagerImplWiFi.h (100%) rename src/platform/{nxp/zephyr => Zephyr}/wifi/WiFiManager.cpp (100%) rename src/platform/{nxp/zephyr => Zephyr}/wifi/WiFiManager.h (100%) rename src/platform/{nxp/zephyr/wifi/NxpWifiDriver.cpp => Zephyr/wifi/ZephyrWifiDriver.cpp} (86%) rename src/platform/{nxp/zephyr/wifi/NxpWifiDriver.h => Zephyr/wifi/ZephyrWifiDriver.h} (90%) diff --git a/src/platform/nxp/zephyr/wifi/ConnectivityManagerImplWiFi.cpp b/src/platform/Zephyr/wifi/ConnectivityManagerImplWiFi.cpp similarity index 100% rename from src/platform/nxp/zephyr/wifi/ConnectivityManagerImplWiFi.cpp rename to src/platform/Zephyr/wifi/ConnectivityManagerImplWiFi.cpp diff --git a/src/platform/nxp/zephyr/wifi/ConnectivityManagerImplWiFi.h b/src/platform/Zephyr/wifi/ConnectivityManagerImplWiFi.h similarity index 100% rename from src/platform/nxp/zephyr/wifi/ConnectivityManagerImplWiFi.h rename to src/platform/Zephyr/wifi/ConnectivityManagerImplWiFi.h diff --git a/src/platform/nxp/zephyr/wifi/WiFiManager.cpp b/src/platform/Zephyr/wifi/WiFiManager.cpp similarity index 100% rename from src/platform/nxp/zephyr/wifi/WiFiManager.cpp rename to src/platform/Zephyr/wifi/WiFiManager.cpp diff --git a/src/platform/nxp/zephyr/wifi/WiFiManager.h b/src/platform/Zephyr/wifi/WiFiManager.h similarity index 100% rename from src/platform/nxp/zephyr/wifi/WiFiManager.h rename to src/platform/Zephyr/wifi/WiFiManager.h diff --git a/src/platform/nxp/zephyr/wifi/NxpWifiDriver.cpp b/src/platform/Zephyr/wifi/ZephyrWifiDriver.cpp similarity index 86% rename from src/platform/nxp/zephyr/wifi/NxpWifiDriver.cpp rename to src/platform/Zephyr/wifi/ZephyrWifiDriver.cpp index f3969a583221e6..53b7fa684a2213 100644 --- a/src/platform/nxp/zephyr/wifi/NxpWifiDriver.cpp +++ b/src/platform/Zephyr/wifi/ZephyrWifiDriver.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ -#include "NxpWifiDriver.h" +#include "ZephyrWifiDriver.h" #include @@ -32,13 +32,13 @@ namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { -size_t NxpWifiDriver::WiFiNetworkIterator::Count() +size_t ZephyrWifiDriver::WiFiNetworkIterator::Count() { VerifyOrReturnValue(mDriver != nullptr, 0); return mDriver->mStagingNetwork.IsConfigured() ? 1 : 0; } -bool NxpWifiDriver::WiFiNetworkIterator::Next(Network & item) +bool ZephyrWifiDriver::WiFiNetworkIterator::Next(Network & item) { // we assume only one network is actually supported // TODO: verify if this can be extended @@ -67,7 +67,7 @@ bool NxpWifiDriver::WiFiNetworkIterator::Next(Network & item) return true; } -bool NxpWifiScanResponseIterator::Next(WiFiScanResponse & item) +bool ZephyrWifiScanResponseIterator::Next(WiFiScanResponse & item) { if (mResultId < mResultCount) { @@ -77,14 +77,14 @@ bool NxpWifiScanResponseIterator::Next(WiFiScanResponse & item) return false; } -void NxpWifiScanResponseIterator::Release() +void ZephyrWifiScanResponseIterator::Release() { mResultId = mResultCount = 0; Platform::MemoryFree(mResults); mResults = nullptr; } -void NxpWifiScanResponseIterator::Add(const WiFiScanResponse & result) +void ZephyrWifiScanResponseIterator::Add(const WiFiScanResponse & result) { void * newResults = Platform::MemoryRealloc(mResults, (mResultCount + 1) * sizeof(WiFiScanResponse)); @@ -95,7 +95,7 @@ void NxpWifiScanResponseIterator::Add(const WiFiScanResponse & result) } } -CHIP_ERROR NxpWifiDriver::Init(NetworkStatusChangeCallback * networkStatusChangeCallback) +CHIP_ERROR ZephyrWifiDriver::Init(NetworkStatusChangeCallback * networkStatusChangeCallback) { mpNetworkStatusChangeCallback = networkStatusChangeCallback; @@ -113,7 +113,7 @@ CHIP_ERROR NxpWifiDriver::Init(NetworkStatusChangeCallback * networkStatusChange return CHIP_NO_ERROR; } -void NxpWifiDriver::OnNetworkStatusChanged(Status status) +void ZephyrWifiDriver::OnNetworkStatusChanged(Status status) { if (status == Status::kSuccess) { @@ -132,12 +132,12 @@ void NxpWifiDriver::OnNetworkStatusChanged(Status status) } } -void NxpWifiDriver::Shutdown() +void ZephyrWifiDriver::Shutdown() { mpNetworkStatusChangeCallback = nullptr; } -CHIP_ERROR NxpWifiDriver::CommitConfiguration() +CHIP_ERROR ZephyrWifiDriver::CommitConfiguration() { ReturnErrorOnFailure(KeyValueStoreMgr().Put(kPassKey, mStagingNetwork.pass, mStagingNetwork.passLen)); ReturnErrorOnFailure(KeyValueStoreMgr().Put(kSsidKey, mStagingNetwork.ssid, mStagingNetwork.ssidLen)); @@ -145,7 +145,7 @@ CHIP_ERROR NxpWifiDriver::CommitConfiguration() return CHIP_NO_ERROR; } -CHIP_ERROR NxpWifiDriver::RevertConfiguration() +CHIP_ERROR ZephyrWifiDriver::RevertConfiguration() { LoadFromStorage(); @@ -172,8 +172,8 @@ CHIP_ERROR NxpWifiDriver::RevertConfiguration() return CHIP_NO_ERROR; } -Status NxpWifiDriver::AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials, MutableCharSpan & outDebugText, - uint8_t & outNetworkIndex) +Status ZephyrWifiDriver::AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials, MutableCharSpan & outDebugText, + uint8_t & outNetworkIndex) { outDebugText = {}; outNetworkIndex = 0; @@ -191,7 +191,7 @@ Status NxpWifiDriver::AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials, Mu return Status::kSuccess; } -Status NxpWifiDriver::RemoveNetwork(ByteSpan networkId, MutableCharSpan & outDebugText, uint8_t & outNetworkIndex) +Status ZephyrWifiDriver::RemoveNetwork(ByteSpan networkId, MutableCharSpan & outDebugText, uint8_t & outNetworkIndex) { outDebugText = {}; outNetworkIndex = 0; @@ -202,7 +202,7 @@ Status NxpWifiDriver::RemoveNetwork(ByteSpan networkId, MutableCharSpan & outDeb return Status::kSuccess; } -Status NxpWifiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index, MutableCharSpan & outDebugText) +Status ZephyrWifiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index, MutableCharSpan & outDebugText) { outDebugText = {}; @@ -213,7 +213,7 @@ Status NxpWifiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index, MutableC return Status::kSuccess; } -void NxpWifiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback) +void ZephyrWifiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback) { Status status = Status::kSuccess; WiFiManager::StationStatus stationStatus; @@ -252,7 +252,7 @@ void NxpWifiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callbac } } -void NxpWifiDriver::LoadFromStorage() +void ZephyrWifiDriver::LoadFromStorage() { WiFiManager::WiFiNetwork network; @@ -262,7 +262,7 @@ void NxpWifiDriver::LoadFromStorage() mStagingNetwork = network; } -void NxpWifiDriver::OnScanWiFiNetworkDone(WiFiManager::WiFiRequestStatus status) +void ZephyrWifiDriver::OnScanWiFiNetworkDone(WiFiManager::WiFiRequestStatus status) { VerifyOrReturn(mScanCallback != nullptr); mScanCallback->OnFinished(status == WiFiManager::WiFiRequestStatus::SUCCESS ? Status::kSuccess : Status::kUnknownError, @@ -270,12 +270,12 @@ void NxpWifiDriver::OnScanWiFiNetworkDone(WiFiManager::WiFiRequestStatus status) mScanCallback = nullptr; } -void NxpWifiDriver::OnScanWiFiNetworkResult(const WiFiScanResponse & response) +void ZephyrWifiDriver::OnScanWiFiNetworkResult(const WiFiScanResponse & response) { mScanResponseIterator.Add(response); } -void NxpWifiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) +void ZephyrWifiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) { mScanCallback = callback; CHIP_ERROR error = WiFiManager::Instance().Scan( diff --git a/src/platform/nxp/zephyr/wifi/NxpWifiDriver.h b/src/platform/Zephyr/wifi/ZephyrWifiDriver.h similarity index 90% rename from src/platform/nxp/zephyr/wifi/NxpWifiDriver.h rename to src/platform/Zephyr/wifi/ZephyrWifiDriver.h index 01e4964e2ea046..9096aa408b69bd 100644 --- a/src/platform/nxp/zephyr/wifi/NxpWifiDriver.h +++ b/src/platform/Zephyr/wifi/ZephyrWifiDriver.h @@ -29,7 +29,7 @@ constexpr uint8_t kMaxWiFiNetworks = 1; constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 35; -class NxpWifiScanResponseIterator : public Iterator +class ZephyrWifiScanResponseIterator : public Iterator { public: size_t Count() override { return mResultCount; } @@ -43,7 +43,7 @@ class NxpWifiScanResponseIterator : public Iterator WiFiScanResponse * mResults = nullptr; }; -class NxpWifiDriver final : public WiFiDriver +class ZephyrWifiDriver final : public WiFiDriver { public: // Define non-volatile storage keys for SSID and password. @@ -54,14 +54,14 @@ class NxpWifiDriver final : public WiFiDriver class WiFiNetworkIterator final : public NetworkIterator { public: - WiFiNetworkIterator(NxpWifiDriver * aDriver) : mDriver(aDriver) {} + WiFiNetworkIterator(ZephyrWifiDriver * aDriver) : mDriver(aDriver) {} size_t Count() override; bool Next(Network & item) override; void Release() override { delete this; } ~WiFiNetworkIterator() = default; private: - NxpWifiDriver * mDriver; + ZephyrWifiDriver * mDriver; bool mExhausted{ false }; }; @@ -87,9 +87,9 @@ class NxpWifiDriver final : public WiFiDriver uint8_t & outNetworkIndex) override; void ScanNetworks(ByteSpan ssid, ScanCallback * callback) override; - static NxpWifiDriver & Instance() + static ZephyrWifiDriver & Instance() { - static NxpWifiDriver sInstance; + static ZephyrWifiDriver sInstance; return sInstance; } @@ -103,7 +103,7 @@ class NxpWifiDriver final : public WiFiDriver ConnectCallback * mpConnectCallback{ nullptr }; NetworkStatusChangeCallback * mpNetworkStatusChangeCallback{ nullptr }; WiFiManager::WiFiNetwork mStagingNetwork; - NxpWifiScanResponseIterator mScanResponseIterator; + ZephyrWifiScanResponseIterator mScanResponseIterator; ScanCallback * mScanCallback{ nullptr }; }; diff --git a/src/platform/nxp/zephyr/BUILD.gn b/src/platform/nxp/zephyr/BUILD.gn index 1c370750d911a6..bdf1f2bba9d324 100644 --- a/src/platform/nxp/zephyr/BUILD.gn +++ b/src/platform/nxp/zephyr/BUILD.gn @@ -87,12 +87,12 @@ static_library("nxp_zephyr") { sources += [ "../../Zephyr/InetUtils.cpp", "../../Zephyr/InetUtils.h", - "wifi/ConnectivityManagerImplWiFi.cpp", - "wifi/ConnectivityManagerImplWiFi.h", - "wifi/NxpWifiDriver.cpp", - "wifi/NxpWifiDriver.h", - "wifi/WiFiManager.cpp", - "wifi/WiFiManager.h", + "../../Zephyr/wifi/ConnectivityManagerImplWiFi.cpp", + "../../Zephyr/wifi/ConnectivityManagerImplWiFi.h", + "../../Zephyr/wifi/WiFiManager.cpp", + "../../Zephyr/wifi/WiFiManager.h", + "../../Zephyr/wifi/ZephyrWifiDriver.cpp", + "../../Zephyr/wifi/ZephyrWifiDriver.h", ] } diff --git a/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h b/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h index 7a80a39a3f77b2..900aa846e49d5c 100644 --- a/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h +++ b/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h @@ -105,7 +105,7 @@ // ========== Platform-specific Configuration Overrides ========= #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY -#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY (K_PRIO_PREEMPT(1)) +#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY (K_PRIO_PREEMPT(5)) #endif // CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE diff --git a/src/platform/nxp/zephyr/ConnectivityManagerImpl.h b/src/platform/nxp/zephyr/ConnectivityManagerImpl.h index 6d7a717886a7eb..c43d6a35dcb841 100644 --- a/src/platform/nxp/zephyr/ConnectivityManagerImpl.h +++ b/src/platform/nxp/zephyr/ConnectivityManagerImpl.h @@ -36,7 +36,7 @@ #endif #if CHIP_DEVICE_CONFIG_ENABLE_WIFI -#include "wifi/ConnectivityManagerImplWiFi.h" +#include #else #include #endif diff --git a/src/platform/nxp/zephyr/DiagnosticDataProviderImplNxp.cpp b/src/platform/nxp/zephyr/DiagnosticDataProviderImplNxp.cpp index b7f0e2523610a5..6c3481da234719 100644 --- a/src/platform/nxp/zephyr/DiagnosticDataProviderImplNxp.cpp +++ b/src/platform/nxp/zephyr/DiagnosticDataProviderImplNxp.cpp @@ -24,7 +24,7 @@ #include "DiagnosticDataProviderImplNxp.h" #ifdef CONFIG_WIFI_NXP -#include +#include #endif namespace chip { From 0af9905912b61497ee3cb796b0b838ded44d8e1d Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 1 Mar 2024 20:29:40 +0100 Subject: [PATCH 18/19] [Docker][Python] Add ruff Python linter to chip-build (#32388) * [Python] Add ruff Python linter to chip-build * Update subject --- integrations/docker/images/base/chip-build/Dockerfile | 1 + integrations/docker/images/base/chip-build/version | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/integrations/docker/images/base/chip-build/Dockerfile b/integrations/docker/images/base/chip-build/Dockerfile index b16429fcc8eab2..39aada6fec7af8 100644 --- a/integrations/docker/images/base/chip-build/Dockerfile +++ b/integrations/docker/images/base/chip-build/Dockerfile @@ -152,6 +152,7 @@ RUN set -x \ portpicker \ pygit \ PyGithub \ + ruff \ tabulate \ && : # last line diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index fe142046be7c1c..bfe684b756a04d 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -38 : [NXP] Update Docker image for K32W1 SDK +39 : [Python] Add ruff Python linter to chip-build From fa9bfbd3ae3aa0e6631f4cc2e7db50aabedc0969 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:51:57 -0500 Subject: [PATCH 19/19] [ICD] Add missing include for the ICD specific defines (#32386) * Add missing include to the RMP config * add header to every file that uses ICD defines * add dependency to linux static lib --- src/app/tests/TestReadInteraction.cpp | 1 + src/include/platform/ThreadStackManager.h | 2 ++ .../internal/GenericConnectivityManagerImpl_Thread.h | 1 + .../platform/internal/GenericConnectivityManagerImpl_WiFi.h | 1 + src/messaging/ReliableMessageMgr.cpp | 1 + src/messaging/ReliableMessageProtocolConfig.cpp | 5 ++--- src/messaging/tests/TestAbortExchangesForFabric.cpp | 1 + src/messaging/tests/TestReliableMessageProtocol.cpp | 1 + src/platform/Linux/BUILD.gn | 1 + src/platform/Linux/ThreadStackManagerImpl.h | 1 + .../OpenThread/GenericThreadStackManagerImpl_OpenThread.h | 1 + src/protocols/secure_channel/tests/TestPASESession.cpp | 1 + 12 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index 9e8bc58e5d87da..13ae20862a4c35 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/src/include/platform/ThreadStackManager.h b/src/include/platform/ThreadStackManager.h index cda3c7acdccbd5..523b4fe8ceaad9 100644 --- a/src/include/platform/ThreadStackManager.h +++ b/src/include/platform/ThreadStackManager.h @@ -23,6 +23,8 @@ #pragma once +#include + #include #include #include diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h index 456d843c488224..3e0e6c1a18a171 100755 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h @@ -25,6 +25,7 @@ #pragma once #include +#include #include #include diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h index 61c2db51954c8e..24cc0032389280 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h @@ -23,6 +23,7 @@ #pragma once +#include #include #include #include diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index 2db80c5ffd337e..2445bf4611a06e 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/src/messaging/ReliableMessageProtocolConfig.cpp b/src/messaging/ReliableMessageProtocolConfig.cpp index d1a4deece9c0f8..d2cda6123af5cb 100644 --- a/src/messaging/ReliableMessageProtocolConfig.cpp +++ b/src/messaging/ReliableMessageProtocolConfig.cpp @@ -21,14 +21,13 @@ * for the CHIP Reliable Messaging Protocol. * */ - #include +#include +#include #include #include -#include - #if CHIP_CONFIG_ENABLE_ICD_SERVER #include // nogncheck #endif diff --git a/src/messaging/tests/TestAbortExchangesForFabric.cpp b/src/messaging/tests/TestAbortExchangesForFabric.cpp index 455462bb14e2e4..a9999eb6c2f9e0 100644 --- a/src/messaging/tests/TestAbortExchangesForFabric.cpp +++ b/src/messaging/tests/TestAbortExchangesForFabric.cpp @@ -21,6 +21,7 @@ * one) for a fabric. */ +#include #include #include #include diff --git a/src/messaging/tests/TestReliableMessageProtocol.cpp b/src/messaging/tests/TestReliableMessageProtocol.cpp index cfdd00bff624f5..505a54f4b0a11e 100644 --- a/src/messaging/tests/TestReliableMessageProtocol.cpp +++ b/src/messaging/tests/TestReliableMessageProtocol.cpp @@ -22,6 +22,7 @@ * implementation. */ +#include #include #include #include diff --git a/src/platform/Linux/BUILD.gn b/src/platform/Linux/BUILD.gn index 061f052869d883..4f28b2d520e066 100644 --- a/src/platform/Linux/BUILD.gn +++ b/src/platform/Linux/BUILD.gn @@ -74,6 +74,7 @@ static_library("Linux") { ] deps = [ + "${chip_root}/src/app/icd/server:icd-server-config", "${chip_root}/src/credentials:credentials_header", "${chip_root}/src/setup_payload", ] diff --git a/src/platform/Linux/ThreadStackManagerImpl.h b/src/platform/Linux/ThreadStackManagerImpl.h index e262837dd84c76..8b0cf242bcbd34 100755 --- a/src/platform/Linux/ThreadStackManagerImpl.h +++ b/src/platform/Linux/ThreadStackManagerImpl.h @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h index 8ce0805182dcaa..aa3d2e1951ce7e 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h @@ -37,6 +37,7 @@ #include #endif +#include #include #include #include diff --git a/src/protocols/secure_channel/tests/TestPASESession.cpp b/src/protocols/secure_channel/tests/TestPASESession.cpp index f94ebb0921a533..a68b69f417838b 100644 --- a/src/protocols/secure_channel/tests/TestPASESession.cpp +++ b/src/protocols/secure_channel/tests/TestPASESession.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include